From e1f070d81a249b29246b53f873ba8e1e1abc8b4a Mon Sep 17 00:00:00 2001 From: cnst Date: Sat, 3 Aug 2024 14:03:54 +0200 Subject: [PATCH] another one --- .gitignore | 4 -- hosts/default.nix | 38 ++++++++++--------- sys/opt/hardware/adampad.nix | 24 ------------ {sys => system}/bin/anyrun/default.nix | 0 {sys => system}/bin/default.nix | 0 {sys => system}/bin/gnome/default.nix | 0 {sys => system}/bin/hyprland/default.nix | 0 .../boot/boot.nix => system/boot/default.nix | 0 .../boot/lanzaboote/default.nix | 0 {sys => system}/default.nix | 15 ++++---- system/etc/bluetooth/default.nix | 8 ++++ {sys => system}/etc/dconf/default.nix | 0 {sys => system}/etc/default.nix | 5 +-- .../etc/graphics/amd/default.nix | 10 ----- .../etc/graphics/nvidia/default.nix | 6 --- system/etc/logitech/default.nix | 8 ++++ .../etc/network/adampad/default.nix | 0 .../etc/network/cnix/default.nix | 0 .../etc/network/toothpc/default.nix | 0 {sys => system}/etc/nix-ld/default.nix | 0 {sys => system}/etc/security/default.nix | 0 {sys => system}/etc/xdg/default.nix | 0 .../etc/xserver/amd/default.nix | 0 .../etc/xserver/amd/hhkbse/default.nix | 2 +- .../etc/xserver/nvidia/default.nix | 0 system/etc/zram/default.nix | 1 + {sys => system}/etc/zsh/default.nix | 0 {sys/nixos => system/nix}/default.nix | 0 {sys => system/nix}/dev/dev.nix | 0 .../nix}/home-manager/default.nix | 0 .../nix/nh/adampad/default.nix | 0 .../nix/nh/cnix/default.nix | 0 .../nix/nh/toothpc/default.nix | 0 {sys/nixos => system/nix}/nixpkgs/default.nix | 0 .../nix}/substituters/default.nix | 0 {sys => system}/srv/audio/default.nix | 0 {sys => system}/srv/blueman/default.nix | 0 {sys => system}/srv/dbus/default.nix | 0 {sys => system}/srv/default.nix | 0 {sys => system}/srv/fwupd/default.nix | 0 {sys => system}/srv/gnome-keyring/default.nix | 0 {sys => system}/srv/greetd/default.nix | 0 {sys => system}/srv/gvfs/default.nix | 0 {sys => system}/srv/locate/default.nix | 0 {sys => system}/srv/mullvad/default.nix | 0 {sys => system}/srv/openssh/default.nix | 0 {sys => system}/srv/power/default.nix | 0 {sys => system}/srv/samba/default.nix | 0 {sys => system}/srv/udisks/default.nix | 0 {sys => system/usr}/bin/android/default.nix | 0 {sys => system/usr}/bin/bottles/default.nix | 0 {sys => system/usr}/bin/corectrl/default.nix | 0 {sys => system/usr}/bin/gamemode/default.nix | 0 {sys => system/usr}/bin/gamescope/default.nix | 0 {sys => system/usr}/bin/gaming.nix | 0 {sys => system/usr}/bin/gimp/default.nix | 0 {sys => system/usr}/bin/inkscape/default.nix | 0 {sys => system/usr}/bin/lutris/default.nix | 0 {sys => system/usr}/bin/steam/default.nix | 0 system/usr/share/default.nix | 7 ++++ .../usr/share}/fonts/default.nix | 0 .../usr/share}/locale/default.nix | 0 62 files changed, 56 insertions(+), 72 deletions(-) delete mode 100644 sys/opt/hardware/adampad.nix rename {sys => system}/bin/anyrun/default.nix (100%) rename {sys => system}/bin/default.nix (100%) rename {sys => system}/bin/gnome/default.nix (100%) rename {sys => system}/bin/hyprland/default.nix (100%) rename sys/opt/boot/boot.nix => system/boot/default.nix (100%) rename sys/opt/boot/lanzaboote.nix => system/boot/lanzaboote/default.nix (100%) rename {sys => system}/default.nix (64%) create mode 100644 system/etc/bluetooth/default.nix rename {sys => system}/etc/dconf/default.nix (100%) rename {sys => system}/etc/default.nix (63%) rename sys/opt/hardware/cnix.nix => system/etc/graphics/amd/default.nix (72%) rename sys/opt/hardware/toothpc.nix => system/etc/graphics/nvidia/default.nix (84%) create mode 100644 system/etc/logitech/default.nix rename sys/opt/network/adampad.nix => system/etc/network/adampad/default.nix (100%) rename sys/opt/network/cnix.nix => system/etc/network/cnix/default.nix (100%) rename sys/opt/network/toothpc.nix => system/etc/network/toothpc/default.nix (100%) rename {sys => system}/etc/nix-ld/default.nix (100%) rename {sys => system}/etc/security/default.nix (100%) rename {sys => system}/etc/xdg/default.nix (100%) rename sys/opt/xserver/adampad.nix => system/etc/xserver/amd/default.nix (100%) rename sys/opt/xserver/cnix.nix => system/etc/xserver/amd/hhkbse/default.nix (96%) rename sys/opt/xserver/toothpc.nix => system/etc/xserver/nvidia/default.nix (100%) create mode 100644 system/etc/zram/default.nix rename {sys => system}/etc/zsh/default.nix (100%) rename {sys/nixos => system/nix}/default.nix (100%) rename {sys => system/nix}/dev/dev.nix (100%) rename {sys/nixos => system/nix}/home-manager/default.nix (100%) rename sys/opt/nh/adampad.nix => system/nix/nh/adampad/default.nix (100%) rename sys/opt/nh/cnix.nix => system/nix/nh/cnix/default.nix (100%) rename sys/opt/nh/toothpc.nix => system/nix/nh/toothpc/default.nix (100%) rename {sys/nixos => system/nix}/nixpkgs/default.nix (100%) rename {sys/nixos => system/nix}/substituters/default.nix (100%) rename {sys => system}/srv/audio/default.nix (100%) rename {sys => system}/srv/blueman/default.nix (100%) rename {sys => system}/srv/dbus/default.nix (100%) rename {sys => system}/srv/default.nix (100%) rename {sys => system}/srv/fwupd/default.nix (100%) rename {sys => system}/srv/gnome-keyring/default.nix (100%) rename {sys => system}/srv/greetd/default.nix (100%) rename {sys => system}/srv/gvfs/default.nix (100%) rename {sys => system}/srv/locate/default.nix (100%) rename {sys => system}/srv/mullvad/default.nix (100%) rename {sys => system}/srv/openssh/default.nix (100%) rename {sys => system}/srv/power/default.nix (100%) rename {sys => system}/srv/samba/default.nix (100%) rename {sys => system}/srv/udisks/default.nix (100%) rename {sys => system/usr}/bin/android/default.nix (100%) rename {sys => system/usr}/bin/bottles/default.nix (100%) rename {sys => system/usr}/bin/corectrl/default.nix (100%) rename {sys => system/usr}/bin/gamemode/default.nix (100%) rename {sys => system/usr}/bin/gamescope/default.nix (100%) rename {sys => system/usr}/bin/gaming.nix (100%) rename {sys => system/usr}/bin/gimp/default.nix (100%) rename {sys => system/usr}/bin/inkscape/default.nix (100%) rename {sys => system/usr}/bin/lutris/default.nix (100%) rename {sys => system/usr}/bin/steam/default.nix (100%) create mode 100644 system/usr/share/default.nix rename {sys/etc => system/usr/share}/fonts/default.nix (100%) rename {sys/etc => system/usr/share}/locale/default.nix (100%) diff --git a/.gitignore b/.gitignore index 911687dc..92b27930 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1 @@ -nix/ -nix/sources.json -nix/sources.nix .direnv -.pre-commit-config.yaml diff --git a/hosts/default.nix b/hosts/default.nix index a07f8fc1..98e4a686 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -7,10 +7,10 @@ flake.nixosConfigurations = let # shorten paths inherit (inputs.nixpkgs.lib) nixosSystem; - mod = "${self}/sys"; + mod = "${self}/system"; # get the basic config to build on top of - inherit (import "${self}/sys") adampad cnix toothpc; + inherit (import "${self}/system") adampad cnix toothpc; # get these into the module system specialArgs = {inherit inputs self;}; @@ -21,11 +21,13 @@ cnix ++ [ ./cnix - "${mod}/opt/boot/lanzaboote.nix" - "${mod}/opt/hardware/cnix.nix" - "${mod}/opt/network/cnix.nix" - "${mod}/opt/nh/cnix.nix" - "${mod}/opt/xserver/cnix.nix" + "${mod}/boot/lanzaboote" + "${mod}/etc/bluetooth" + "${mod}/etc/graphics/amd" + "${mod}/etc/logitech" + "${mod}/etc/network/cnix" + "${mod}/etc/xserver/amd" + "${mod}/nix/nh/cnix" { home-manager = { users.cnst.imports = homeImports."cnst@cnix"; @@ -43,11 +45,12 @@ toothpc ++ [ ./toothpc - "${mod}/opt/boot/lanzaboote.nix" - "${mod}/opt/hardware/toothpc.nix" - "${mod}/opt/network/toothpc.nix" - "${mod}/opt/nh/toothpc.nix" - "${mod}/opt/xserver/toothpc.nix" + "${mod}/boot/lanzaboote" + "${mod}/etc/graphics/nvidia" + "${mod}/etc/logitech" + "${mod}/etc/network/toothpc" + "${mod}/etc/xserver/nvidia" + "${mod}/nix/nh/toothpc" { home-manager = { users.toothpick.imports = homeImports."toothpick@toothpc"; @@ -65,11 +68,12 @@ adampad ++ [ ./adampad - "${mod}/opt/boot/boot.nix" - "${mod}/opt/hardware/adampad.nix" - "${mod}/opt/network/adampad.nix" - "${mod}/opt/nh/adampad.nix" - "${mod}/opt/xserver/adampad.nix" + "${mod}/boot" + "${mod}/etc/bluetooth" + "${mod}/etc/graphics/amd" + "${mod}/etc/network/adampad" + "${mod}/etc/xserver/amd" + "${mod}/nix/nh/adampad" { home-manager = { users.adam.imports = homeImports."adam@adampad"; diff --git a/sys/opt/hardware/adampad.nix b/sys/opt/hardware/adampad.nix deleted file mode 100644 index 441fdcb8..00000000 --- a/sys/opt/hardware/adampad.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - pkgs, - lib, - config, - inputs, - ... -}: { - zramSwap.enable = true; - - hardware = { - bluetooth = { - enable = true; - powerOnBoot = true; - }; - graphics = { - enable = true; - extraPackages = with pkgs; [ - libva - vaapiVdpau - libvdpau-va-gl - ]; - }; - }; -} diff --git a/sys/bin/anyrun/default.nix b/system/bin/anyrun/default.nix similarity index 100% rename from sys/bin/anyrun/default.nix rename to system/bin/anyrun/default.nix diff --git a/sys/bin/default.nix b/system/bin/default.nix similarity index 100% rename from sys/bin/default.nix rename to system/bin/default.nix diff --git a/sys/bin/gnome/default.nix b/system/bin/gnome/default.nix similarity index 100% rename from sys/bin/gnome/default.nix rename to system/bin/gnome/default.nix diff --git a/sys/bin/hyprland/default.nix b/system/bin/hyprland/default.nix similarity index 100% rename from sys/bin/hyprland/default.nix rename to system/bin/hyprland/default.nix diff --git a/sys/opt/boot/boot.nix b/system/boot/default.nix similarity index 100% rename from sys/opt/boot/boot.nix rename to system/boot/default.nix diff --git a/sys/opt/boot/lanzaboote.nix b/system/boot/lanzaboote/default.nix similarity index 100% rename from sys/opt/boot/lanzaboote.nix rename to system/boot/lanzaboote/default.nix diff --git a/sys/default.nix b/system/default.nix similarity index 64% rename from sys/default.nix rename to system/default.nix index b63fe017..f7fb7c79 100644 --- a/sys/default.nix +++ b/system/default.nix @@ -1,9 +1,10 @@ let shared = [ - ./nixos - ./etc ./bin + ./etc + ./nix ./srv + ./usr/share ]; adampad = @@ -15,16 +16,16 @@ let cnix = shared ++ [ - ./bin/gaming.nix - ./bin/android - ./bin/gimp - ./bin/inkscape + ./usr/bin/gaming.nix + ./usr/bin/android + ./usr/bin/gimp + ./usr/bin/inkscape ./srv/blueman ]; toothpc = shared ++ [ - ./bin/gaming.nix + ./usr/bin/gaming.nix ]; in { inherit shared adampad cnix toothpc; diff --git a/system/etc/bluetooth/default.nix b/system/etc/bluetooth/default.nix new file mode 100644 index 00000000..3099b9bc --- /dev/null +++ b/system/etc/bluetooth/default.nix @@ -0,0 +1,8 @@ +{ + hardware = { + bluetooth = { + enable = true; + powerOnBoot = false; + }; + }; +} diff --git a/sys/etc/dconf/default.nix b/system/etc/dconf/default.nix similarity index 100% rename from sys/etc/dconf/default.nix rename to system/etc/dconf/default.nix diff --git a/sys/etc/default.nix b/system/etc/default.nix similarity index 63% rename from sys/etc/default.nix rename to system/etc/default.nix index 67c51708..3cbdfb8b 100644 --- a/sys/etc/default.nix +++ b/system/etc/default.nix @@ -1,11 +1,10 @@ { imports = [ + # shared imports ./dconf - ./fonts - ./locale - # ./nix-ld ./security ./xdg + ./zram ./zsh ]; } diff --git a/sys/opt/hardware/cnix.nix b/system/etc/graphics/amd/default.nix similarity index 72% rename from sys/opt/hardware/cnix.nix rename to system/etc/graphics/amd/default.nix index e6464648..4ac58d89 100644 --- a/sys/opt/hardware/cnix.nix +++ b/system/etc/graphics/amd/default.nix @@ -1,15 +1,5 @@ {pkgs, ...}: { - zramSwap.enable = true; - hardware = { - bluetooth = { - enable = true; - powerOnBoot = false; - }; - logitech.wireless = { - enable = true; - enableGraphical = true; - }; graphics = { enable = true; enable32Bit = true; diff --git a/sys/opt/hardware/toothpc.nix b/system/etc/graphics/nvidia/default.nix similarity index 84% rename from sys/opt/hardware/toothpc.nix rename to system/etc/graphics/nvidia/default.nix index 2623165d..090e72b3 100644 --- a/sys/opt/hardware/toothpc.nix +++ b/system/etc/graphics/nvidia/default.nix @@ -3,13 +3,7 @@ config, ... }: { - zramSwap.enable = true; - hardware = { - logitech.wireless = { - enable = true; - enableGraphical = true; - }; graphics = { enable = true; enable32Bit = true; diff --git a/system/etc/logitech/default.nix b/system/etc/logitech/default.nix new file mode 100644 index 00000000..4f90ee5b --- /dev/null +++ b/system/etc/logitech/default.nix @@ -0,0 +1,8 @@ +{ + hardware = { + logitech.wireless = { + enable = true; + enableGraphical = true; + }; + }; +} diff --git a/sys/opt/network/adampad.nix b/system/etc/network/adampad/default.nix similarity index 100% rename from sys/opt/network/adampad.nix rename to system/etc/network/adampad/default.nix diff --git a/sys/opt/network/cnix.nix b/system/etc/network/cnix/default.nix similarity index 100% rename from sys/opt/network/cnix.nix rename to system/etc/network/cnix/default.nix diff --git a/sys/opt/network/toothpc.nix b/system/etc/network/toothpc/default.nix similarity index 100% rename from sys/opt/network/toothpc.nix rename to system/etc/network/toothpc/default.nix diff --git a/sys/etc/nix-ld/default.nix b/system/etc/nix-ld/default.nix similarity index 100% rename from sys/etc/nix-ld/default.nix rename to system/etc/nix-ld/default.nix diff --git a/sys/etc/security/default.nix b/system/etc/security/default.nix similarity index 100% rename from sys/etc/security/default.nix rename to system/etc/security/default.nix diff --git a/sys/etc/xdg/default.nix b/system/etc/xdg/default.nix similarity index 100% rename from sys/etc/xdg/default.nix rename to system/etc/xdg/default.nix diff --git a/sys/opt/xserver/adampad.nix b/system/etc/xserver/amd/default.nix similarity index 100% rename from sys/opt/xserver/adampad.nix rename to system/etc/xserver/amd/default.nix diff --git a/sys/opt/xserver/cnix.nix b/system/etc/xserver/amd/hhkbse/default.nix similarity index 96% rename from sys/opt/xserver/cnix.nix rename to system/etc/xserver/amd/hhkbse/default.nix index 980d61d5..29c2106e 100644 --- a/sys/opt/xserver/cnix.nix +++ b/system/etc/xserver/amd/hhkbse/default.nix @@ -1,4 +1,4 @@ -{config, ...}: { +{ services.xserver = { enable = true; videoDrivers = ["amdgpu"]; diff --git a/sys/opt/xserver/toothpc.nix b/system/etc/xserver/nvidia/default.nix similarity index 100% rename from sys/opt/xserver/toothpc.nix rename to system/etc/xserver/nvidia/default.nix diff --git a/system/etc/zram/default.nix b/system/etc/zram/default.nix new file mode 100644 index 00000000..0f13d841 --- /dev/null +++ b/system/etc/zram/default.nix @@ -0,0 +1 @@ +{zramSwap.enable = true;} diff --git a/sys/etc/zsh/default.nix b/system/etc/zsh/default.nix similarity index 100% rename from sys/etc/zsh/default.nix rename to system/etc/zsh/default.nix diff --git a/sys/nixos/default.nix b/system/nix/default.nix similarity index 100% rename from sys/nixos/default.nix rename to system/nix/default.nix diff --git a/sys/dev/dev.nix b/system/nix/dev/dev.nix similarity index 100% rename from sys/dev/dev.nix rename to system/nix/dev/dev.nix diff --git a/sys/nixos/home-manager/default.nix b/system/nix/home-manager/default.nix similarity index 100% rename from sys/nixos/home-manager/default.nix rename to system/nix/home-manager/default.nix diff --git a/sys/opt/nh/adampad.nix b/system/nix/nh/adampad/default.nix similarity index 100% rename from sys/opt/nh/adampad.nix rename to system/nix/nh/adampad/default.nix diff --git a/sys/opt/nh/cnix.nix b/system/nix/nh/cnix/default.nix similarity index 100% rename from sys/opt/nh/cnix.nix rename to system/nix/nh/cnix/default.nix diff --git a/sys/opt/nh/toothpc.nix b/system/nix/nh/toothpc/default.nix similarity index 100% rename from sys/opt/nh/toothpc.nix rename to system/nix/nh/toothpc/default.nix diff --git a/sys/nixos/nixpkgs/default.nix b/system/nix/nixpkgs/default.nix similarity index 100% rename from sys/nixos/nixpkgs/default.nix rename to system/nix/nixpkgs/default.nix diff --git a/sys/nixos/substituters/default.nix b/system/nix/substituters/default.nix similarity index 100% rename from sys/nixos/substituters/default.nix rename to system/nix/substituters/default.nix diff --git a/sys/srv/audio/default.nix b/system/srv/audio/default.nix similarity index 100% rename from sys/srv/audio/default.nix rename to system/srv/audio/default.nix diff --git a/sys/srv/blueman/default.nix b/system/srv/blueman/default.nix similarity index 100% rename from sys/srv/blueman/default.nix rename to system/srv/blueman/default.nix diff --git a/sys/srv/dbus/default.nix b/system/srv/dbus/default.nix similarity index 100% rename from sys/srv/dbus/default.nix rename to system/srv/dbus/default.nix diff --git a/sys/srv/default.nix b/system/srv/default.nix similarity index 100% rename from sys/srv/default.nix rename to system/srv/default.nix diff --git a/sys/srv/fwupd/default.nix b/system/srv/fwupd/default.nix similarity index 100% rename from sys/srv/fwupd/default.nix rename to system/srv/fwupd/default.nix diff --git a/sys/srv/gnome-keyring/default.nix b/system/srv/gnome-keyring/default.nix similarity index 100% rename from sys/srv/gnome-keyring/default.nix rename to system/srv/gnome-keyring/default.nix diff --git a/sys/srv/greetd/default.nix b/system/srv/greetd/default.nix similarity index 100% rename from sys/srv/greetd/default.nix rename to system/srv/greetd/default.nix diff --git a/sys/srv/gvfs/default.nix b/system/srv/gvfs/default.nix similarity index 100% rename from sys/srv/gvfs/default.nix rename to system/srv/gvfs/default.nix diff --git a/sys/srv/locate/default.nix b/system/srv/locate/default.nix similarity index 100% rename from sys/srv/locate/default.nix rename to system/srv/locate/default.nix diff --git a/sys/srv/mullvad/default.nix b/system/srv/mullvad/default.nix similarity index 100% rename from sys/srv/mullvad/default.nix rename to system/srv/mullvad/default.nix diff --git a/sys/srv/openssh/default.nix b/system/srv/openssh/default.nix similarity index 100% rename from sys/srv/openssh/default.nix rename to system/srv/openssh/default.nix diff --git a/sys/srv/power/default.nix b/system/srv/power/default.nix similarity index 100% rename from sys/srv/power/default.nix rename to system/srv/power/default.nix diff --git a/sys/srv/samba/default.nix b/system/srv/samba/default.nix similarity index 100% rename from sys/srv/samba/default.nix rename to system/srv/samba/default.nix diff --git a/sys/srv/udisks/default.nix b/system/srv/udisks/default.nix similarity index 100% rename from sys/srv/udisks/default.nix rename to system/srv/udisks/default.nix diff --git a/sys/bin/android/default.nix b/system/usr/bin/android/default.nix similarity index 100% rename from sys/bin/android/default.nix rename to system/usr/bin/android/default.nix diff --git a/sys/bin/bottles/default.nix b/system/usr/bin/bottles/default.nix similarity index 100% rename from sys/bin/bottles/default.nix rename to system/usr/bin/bottles/default.nix diff --git a/sys/bin/corectrl/default.nix b/system/usr/bin/corectrl/default.nix similarity index 100% rename from sys/bin/corectrl/default.nix rename to system/usr/bin/corectrl/default.nix diff --git a/sys/bin/gamemode/default.nix b/system/usr/bin/gamemode/default.nix similarity index 100% rename from sys/bin/gamemode/default.nix rename to system/usr/bin/gamemode/default.nix diff --git a/sys/bin/gamescope/default.nix b/system/usr/bin/gamescope/default.nix similarity index 100% rename from sys/bin/gamescope/default.nix rename to system/usr/bin/gamescope/default.nix diff --git a/sys/bin/gaming.nix b/system/usr/bin/gaming.nix similarity index 100% rename from sys/bin/gaming.nix rename to system/usr/bin/gaming.nix diff --git a/sys/bin/gimp/default.nix b/system/usr/bin/gimp/default.nix similarity index 100% rename from sys/bin/gimp/default.nix rename to system/usr/bin/gimp/default.nix diff --git a/sys/bin/inkscape/default.nix b/system/usr/bin/inkscape/default.nix similarity index 100% rename from sys/bin/inkscape/default.nix rename to system/usr/bin/inkscape/default.nix diff --git a/sys/bin/lutris/default.nix b/system/usr/bin/lutris/default.nix similarity index 100% rename from sys/bin/lutris/default.nix rename to system/usr/bin/lutris/default.nix diff --git a/sys/bin/steam/default.nix b/system/usr/bin/steam/default.nix similarity index 100% rename from sys/bin/steam/default.nix rename to system/usr/bin/steam/default.nix diff --git a/system/usr/share/default.nix b/system/usr/share/default.nix new file mode 100644 index 00000000..941c2a82 --- /dev/null +++ b/system/usr/share/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + # shared imports + ./fonts + ./locale + ]; +} diff --git a/sys/etc/fonts/default.nix b/system/usr/share/fonts/default.nix similarity index 100% rename from sys/etc/fonts/default.nix rename to system/usr/share/fonts/default.nix diff --git a/sys/etc/locale/default.nix b/system/usr/share/locale/default.nix similarity index 100% rename from sys/etc/locale/default.nix rename to system/usr/share/locale/default.nix