mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
a bunch of code cleanup
This commit is contained in:
parent
977d1ad6d2
commit
016a347d5e
19 changed files with 92 additions and 100 deletions
|
|
@ -63,7 +63,7 @@
|
|||
specialArgs = {inherit self;};
|
||||
modules =
|
||||
importAll ./modules
|
||||
++ importAll "${self}/systems/${name}";
|
||||
++ importAll (self + "/systems/" + name);
|
||||
}
|
||||
);
|
||||
in
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ _: {
|
|||
environment = {
|
||||
noXlibs = lib.mkOverride 500 false;
|
||||
defaultPackages = [];
|
||||
systemPackages = with pkgs; [gitMinimal neovim];
|
||||
systemPackages = [pkgs.gitMinimal pkgs.neovim];
|
||||
variables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,16 +5,15 @@
|
|||
lib,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
}: let
|
||||
cfg = config.localModules.DE.dwm;
|
||||
sp = suckless.packages.${pkgs.system};
|
||||
in {
|
||||
options.localModules.DE.dwm = {
|
||||
enable = mkEnableOption "";
|
||||
enable = lib.mkEnableOption "";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.gvfs.enable = true;
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
|
@ -27,7 +26,7 @@ in {
|
|||
defaultSession = "none+dwm";
|
||||
};
|
||||
windowManager.session =
|
||||
singleton
|
||||
lib.singleton
|
||||
{
|
||||
name = "dwm";
|
||||
start = ''
|
||||
|
|
|
|||
|
|
@ -4,43 +4,40 @@ _: {
|
|||
options,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
}: let
|
||||
cfg = config.localModules.DE.gnome;
|
||||
in {
|
||||
options.localModules.DE.gnome = {
|
||||
enable = mkEnableOption "";
|
||||
enable = lib.mkEnableOption "";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
environment.gnome.excludePackages =
|
||||
(with pkgs; [
|
||||
gnome-photos
|
||||
gnome-tour
|
||||
gnome-text-editor
|
||||
gnome-online-accounts
|
||||
])
|
||||
++ (with pkgs.gnome; [
|
||||
gnome-weather
|
||||
gnome-shell
|
||||
gnome-disk-utility
|
||||
gnome-maps
|
||||
gnome-clocks
|
||||
gnome-remote-desktop
|
||||
gnome-calendar
|
||||
gnome-music
|
||||
simple-scan
|
||||
cheese # webcam tool
|
||||
gedit # text editor
|
||||
epiphany # web browser
|
||||
geary # email reader
|
||||
evince # document viewer
|
||||
gnome-characters
|
||||
totem # video player
|
||||
tali # poker game
|
||||
iagno # go game
|
||||
hitori # sudoku game
|
||||
atomix # puzzle game
|
||||
]);
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.gnome.excludePackages = [
|
||||
pkgs.gnome-photos
|
||||
pkgs.gnome-tour
|
||||
pkgs.gnome-text-editor
|
||||
pkgs.gnome-online-accounts
|
||||
|
||||
pkgs.gnome.gnome-weather
|
||||
pkgs.gnome.gnome-shell
|
||||
pkgs.gnome.gnome-disk-utility
|
||||
pkgs.gnome.gnome-maps
|
||||
pkgs.gnome.gnome-clocks
|
||||
pkgs.gnome.gnome-remote-desktop
|
||||
pkgs.gnome.gnome-calendar
|
||||
pkgs.gnome.gnome-music
|
||||
pkgs.gnome.simple-scan
|
||||
pkgs.gnome.cheese # webcam tool
|
||||
pkgs.gnome.gedit # text editor
|
||||
pkgs.gnome.epiphany # web browser
|
||||
pkgs.gnome.geary # email reader
|
||||
pkgs.gnome.evince # document viewer
|
||||
pkgs.gnome.gnome-characters
|
||||
pkgs.gnome.totem # video player
|
||||
pkgs.gnome.tali # poker game
|
||||
pkgs.gnome.iagno # go game
|
||||
pkgs.gnome.hitori # sudoku game
|
||||
pkgs.gnome.atomix # puzzle game
|
||||
];
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
desktopManager.gnome.enable = true;
|
||||
|
|
|
|||
|
|
@ -3,14 +3,13 @@ _: {
|
|||
lib,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
}: let
|
||||
cfg = config.localModules.DE.xfce;
|
||||
in {
|
||||
options.localModules.DE.xfce = {
|
||||
enable = mkEnableOption "";
|
||||
enable = lib.mkEnableOption "";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
desktopManager.xfce = {
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ _: {
|
|||
lib,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
}: let
|
||||
cfg = config.localModules.DM.autoLogin;
|
||||
in {
|
||||
options.localModules.DM.autoLogin = mkEnableOption "";
|
||||
config = mkIf cfg {
|
||||
options.localModules.DM.autoLogin = lib.mkEnableOption "";
|
||||
config = lib.mkIf cfg {
|
||||
services.xserver.displayManager = {
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@ _: {
|
|||
options,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
}: let
|
||||
cfg = config.localModules.DM.lightdm;
|
||||
in {
|
||||
options.localModules.DM.lightdm = {
|
||||
enable = mkEnableOption "";
|
||||
enable = lib.mkEnableOption "";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.xserver = {
|
||||
displayManager = {
|
||||
lightdm = {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ _: {
|
|||
options,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
options.localModules.DM.loginUser = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
}: {
|
||||
options.localModules.DM.loginUser = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@ _: {
|
|||
options,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
}: let
|
||||
cfg = config.localModules.X11Programs;
|
||||
in {
|
||||
options.localModules.X11Programs = {
|
||||
sxhkd.enable = mkEnableOption "";
|
||||
sxhkd.enable = lib.mkEnableOption "";
|
||||
};
|
||||
config = mkMerge [
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
services.xserver = {
|
||||
tty = lib.mkDefault 1;
|
||||
|
|
@ -56,7 +55,7 @@ in {
|
|||
maim -s | xclip -selection clipboard -t image/png
|
||||
'';
|
||||
in
|
||||
mkIf cfg.sxhkd.enable
|
||||
lib.mkIf cfg.sxhkd.enable
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.maim #screenshooter
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ _: {
|
|||
plymouth = {
|
||||
enable = lib.mkDefault true;
|
||||
theme = "breeze";
|
||||
logo = "${self}/misc/nixos.png";
|
||||
logo = self + /misc/nixos.png;
|
||||
};
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
|
|
|
|||
|
|
@ -4,17 +4,16 @@ _: {
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
}: let
|
||||
cfg = config.localModules.git;
|
||||
in {
|
||||
options.localModules.git = {
|
||||
disable = mkOption {
|
||||
type = types.bool;
|
||||
disable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
config = mkIf (! cfg.disable) {
|
||||
config = lib.mkIf (! cfg.disable) {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitMinimal;
|
||||
|
|
|
|||
|
|
@ -3,27 +3,26 @@ _: {
|
|||
options,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
}: let
|
||||
cfg = config.localModules.hardware;
|
||||
in {
|
||||
options.localModules.hardware = {
|
||||
gpuAcceleration = {
|
||||
disable = mkOption {
|
||||
type = types.bool;
|
||||
disable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
sound = {
|
||||
disable = mkOption {
|
||||
type = types.bool;
|
||||
disable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkMerge [
|
||||
config = lib.mkMerge [
|
||||
(
|
||||
mkIf (! cfg.gpuAcceleration.disable) {
|
||||
lib.mkIf (! cfg.gpuAcceleration.disable) {
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
|
|
@ -31,7 +30,7 @@ in {
|
|||
};
|
||||
}
|
||||
)
|
||||
(mkIf (! cfg.sound.disable) {
|
||||
(lib.mkIf (! cfg.sound.disable) {
|
||||
security.rtkit.enable = true;
|
||||
sound.enable = lib.mkForce false; #disable alsa
|
||||
hardware.pulseaudio.enable = lib.mkForce false; #disable pulseAudio
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ in {
|
|||
#add all inputs to etc
|
||||
environment.etc = lib.mapAttrs' (name: value: lib.nameValuePair "/nixpath/${name}" {source = value;}) combined_flakes;
|
||||
#source the etc paths to nixPath
|
||||
nix.nixPath = lib.mapAttrsToList (name: _: name + "=" + "/etc/nixpath/${name}") combined_flakes;
|
||||
nix.nixPath = lib.mapAttrsToList (name: _: name + "=/etc/nixpath/${name}") combined_flakes;
|
||||
|
||||
#other nix settings
|
||||
nix = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{fetch-rs, ...}: {pkgs, ...}: rec {
|
||||
{fetch-rs, ...}: {
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
#put:
|
||||
#source /run/current-system/sw/share/nix-direnv/direnvrc
|
||||
#in ~/.direnvrc
|
||||
|
|
@ -55,7 +59,7 @@
|
|||
enable = true;
|
||||
execWheelOnly = true;
|
||||
extraConfig = ''
|
||||
Defaults env_keep += "${builtins.concatStringsSep " " (builtins.attrNames environment.variables)}"
|
||||
Defaults env_keep += "${builtins.concatStringsSep " " (builtins.attrNames config.environment.variables)}"
|
||||
Defaults lecture = never
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
pkgs.sops
|
||||
];
|
||||
sops = {
|
||||
defaultSopsFile = "${self}/systems/${config.networking.hostName}/secrets.yaml";
|
||||
defaultSopsFile = self + "/systems/" + config.networking.hostName + "/secrets.yaml";
|
||||
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,17 +4,16 @@ _: {
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
}: let
|
||||
cfg = config.localModules.theming;
|
||||
in {
|
||||
options.localModules.theming = {
|
||||
enable = mkEnableOption "";
|
||||
kmscon.enable = mkEnableOption "";
|
||||
enable = lib.mkEnableOption "";
|
||||
kmscon.enable = lib.mkEnableOption "";
|
||||
};
|
||||
config = mkMerge [
|
||||
config = lib.mkMerge [
|
||||
(
|
||||
mkIf cfg.enable {
|
||||
lib.mkIf cfg.enable {
|
||||
environment = {
|
||||
systemPackages = [
|
||||
pkgs.flat-remix-gtk
|
||||
|
|
@ -81,7 +80,7 @@ in {
|
|||
};
|
||||
}
|
||||
)
|
||||
(mkIf cfg.kmscon.enable {
|
||||
(lib.mkIf cfg.kmscon.enable {
|
||||
services.kmscon = {
|
||||
enable = true;
|
||||
hwRender = false;
|
||||
|
|
|
|||
|
|
@ -9,10 +9,11 @@
|
|||
exec ${glibc}/lib64/ld-linux-x86-64.so.2 \
|
||||
$out/t-rex --no-watchdog \$@
|
||||
'';
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "t-rex-miner";
|
||||
version = "0.26.5";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit version;
|
||||
pname = "t-rex-miner";
|
||||
src = fetchzip {
|
||||
url = "https://github.com/trexminer/T-Rex/releases/download/${version}/t-rex-${version}-linux.tar.gz";
|
||||
sha256 = "sha256-eGOTfb03R2ck/6GMY6tPmTifYT9aVv3dNDQ5jRVlz58=";
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
{spicetify-nix, ...}: {pkgs, ...}: let
|
||||
sp-nix = spicetify-nix;
|
||||
spicePkgs = sp-nix.packages.${pkgs.system}.default;
|
||||
spicePkgs = spicetify-nix.packages.${pkgs.system}.default;
|
||||
ex = spicePkgs.extensions;
|
||||
in {
|
||||
nixpkgs.allowedUnfree = ["spotify"];
|
||||
imports = [sp-nix.nixosModule];
|
||||
imports = [spicetify-nix.nixosModule];
|
||||
programs.spicetify = {
|
||||
spotifyPackage = pkgs.spotify-unwrapped;
|
||||
spicetifyPackage = pkgs.spicetify-cli;
|
||||
enable = true;
|
||||
enabledExtensions = with spicePkgs.extensions; [
|
||||
adblock
|
||||
hidePodcasts
|
||||
shuffle
|
||||
enabledExtensions = [
|
||||
ex.adblock
|
||||
ex.hidePodcasts
|
||||
ex.shuffle
|
||||
];
|
||||
theme = spicePkgs.themes.Dribbblish;
|
||||
colorScheme = "custom";
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ _: {
|
|||
echo 'EndSection' >> $out
|
||||
echo >> $out
|
||||
'';
|
||||
oneMonitor = pkgs.writeText "1-monitor.conf" (lib.strings.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/1-monitor.conf")]);
|
||||
twoMonitor = pkgs.writeText "2-monitor.conf" (lib.strings.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/2-monitor.conf")]);
|
||||
oneMonitor = pkgs.writeText "1-monitor.conf" (lib.strings.concatStrings [(builtins.readFile xserverbase) (builtins.readFile (self + /misc/1-monitor.conf))]);
|
||||
twoMonitor = pkgs.writeText "2-monitor.conf" (lib.strings.concatStrings [(builtins.readFile xserverbase) (builtins.readFile (self + /misc/2-monitor.conf))]);
|
||||
in {
|
||||
boot = {
|
||||
kernelParams = ["amd_iommu=on" "iommu=pt" "vfio_iommu_type1.allow_unsafe_interrupts=1" "kvm.ignore_msrs=1"];
|
||||
|
|
@ -57,7 +57,6 @@ in {
|
|||
patches =
|
||||
old.patches
|
||||
++ [
|
||||
# "${self}/misc/qemu.diff"
|
||||
(pkgs.writeText "qemu.diff" ''
|
||||
diff --git a/ui/input-linux.c b/ui/input-linux.c
|
||||
index e572a2e..a9d76ba 100644
|
||||
|
|
@ -111,7 +110,7 @@ in {
|
|||
'';
|
||||
|
||||
systemd.tmpfiles.rules = let
|
||||
xml = pkgs.writeText "Windows.xml" (builtins.readFile "${self}/misc/Windows.xml");
|
||||
xml = pkgs.writeText "Windows.xml" (builtins.readFile (self + /misc/Windows.xml));
|
||||
qemuHook = pkgs.writeShellScript "qemu-hook" ''
|
||||
GUEST_NAME="$1"
|
||||
OPERATION="$2"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue