From f98ee5581a6df54803b54ce3087e506b182a66ad Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Fri, 17 Nov 2023 13:38:25 +0800 Subject: [PATCH] treewide: sorting --- README.md | 41 +++++-------- .../flake-modules}/home-manager.nix | 0 .../hardware}/imac-2017/default.nix | 0 .../hardware}/imac-2017/hardware.nix | 0 darwin/modules/default.nix | 5 ++ darwin/{ => modules}/networking/default.nix | 0 darwin/modules/networking/dns.nix | 29 +++++++++ darwin/networking/dns.nix | 17 ------ darwin/presets/desktop.nix | 8 --- .../desktop/addtional}/gaming.nix | 0 darwin/profiles/desktop/default.nix | 9 +++ darwin/{ => profiles/desktop}/nix/default.nix | 0 darwin/{ => profiles/desktop}/nix/flake.nix | 0 darwin/{ => profiles/desktop}/nix/gc.nix | 0 darwin/{ => profiles/desktop}/nix/nix.nix | 0 .../{ => profiles/desktop}/packages/core.nix | 0 .../desktop}/packages/default.nix | 0 .../{ => profiles/desktop}/packages/fonts.nix | 0 .../desktop}/packages/homebrew.nix | 0 .../desktop}/packages/unfree.nix | 0 .../{ => profiles/desktop}/system/default.nix | 0 .../{ => profiles/desktop}/system/system.nix | 0 flake.nix | 61 ++++++------------- .../Aristotle/default.nix | 10 --- .../flake-modules}/berberman.nix | 0 .../nixos => nixos/flake-modules}/disko.nix | 0 .../flake-modules}/home-manager.nix | 0 .../nixos => nixos/flake-modules}/hosts.nix | 0 .../flake-modules}/hyprland.nix | 0 .../flake-modules}/impermanence.nix | 0 .../flake-modules}/lanzaboote.nix | 0 .../flake-modules}/sops-nix.nix | 0 .../Aristotle/default.nix | 11 ++++ .../81fw-lenovo-legion-y7000/default.nix | 0 .../81fw-lenovo-legion-y7000/hardware.nix | 0 .../hardware}/hardware/cpu/intel.nix | 0 .../hardware}/hardware/gpu/amd.nix | 0 .../hardware}/hardware/gpu/intel.nix | 0 .../hardware}/hardware/gpu/nvidia-prime.nix | 0 .../hardware}/hardware/gpu/nvidia.nix | 0 .../hardware}/hardware/misc/audio.nix | 0 .../hardware}/hardware/misc/bluetooth.nix | 0 .../hardware}/hardware/misc/opengl.nix | 0 .../hardware}/hardware/misc/tpm.nix | 0 .../hardware}/imac-2017/default.nix | 0 .../hardware}/imac-2017/hardware.nix | 0 nixos/{ => modules}/boot/boot.nix | 0 nixos/{ => modules}/boot/default.nix | 1 - nixos/modules/default.nix | 6 ++ nixos/{ => modules}/networking/default.nix | 0 nixos/{ => modules}/networking/dns.nix | 0 .../network-configuration-daemon.nix | 0 .../core/addtional}/boot/legacy-boot.nix | 0 .../networking/systemd-resolved.nix | 0 .../core/addtional}/zram-generator.nix | 0 .../core.nix => profiles/core/default.nix} | 16 +++-- nixos/{ => profiles/core}/nix/default.nix | 0 nixos/{ => profiles/core}/nix/flake.nix | 0 nixos/{ => profiles/core}/nix/gc.nix | 0 nixos/{ => profiles/core}/nix/nix.nix | 0 .../core}/packages/anti-feature.nix | 0 .../{ => profiles/core}/packages/default.nix | 0 .../{ => profiles/core}/packages/hardware.nix | 0 .../core}/packages/overlays/default.nix | 0 .../core}/packages/overlays/firefox.nix | 0 .../core}/packages/overlays/nautilus.nix | 0 .../core}/packages/overlays/prismlauncher.nix | 0 .../core}/packages/overlays/sway.nix | 0 nixos/{boot => profiles/core}/sysctl.nix | 0 .../addtional}/accessories/logitech.nix | 0 .../desktop/addtional}/accessories/xbox.nix | 0 .../desktop/addtional}/flatpak.nix | 0 .../desktop/addtional}/gaming.nix | 0 .../desktop/addtional}/virt-manager.nix | 0 .../desktop/addtional}/virtualbox.nix | 0 .../desktop/addtional}/wayland.nix | 0 .../desktop/default.nix} | 6 +- .../desktop}/graphical/default.nix | 0 .../desktop}/graphical/display-server.nix | 0 .../desktop}/graphical/gnome-keyring.nix | 0 .../desktop}/graphical/polkit.nix | 0 .../power-management/cpu-governor.nix | 0 .../desktop}/power-management/default.nix | 0 .../power-profiles-daemon.nix | 0 .../power-management/system76-scheduler.nix | 0 .../desktop}/power-management/tlp.nix | 0 .../server/default.nix} | 2 +- nixos/specialisation/default.nix | 21 ------- users/guanranwang/darwin/presets/core.nix | 21 ------- users/guanranwang/darwin/presets/desktop.nix | 19 ------ .../networking/clash-meta-client.nix} | 0 .../darwin/profiles/core/default.nix | 31 ++++++++++ .../desktop/addtional/misc}/gaming.nix | 2 +- .../darwin/profiles/desktop/default.nix | 17 ++++++ .../darwin/{home.nix => default.nix} | 0 .../profiles/graphical-stuff/nixos/fonts.nix | 12 +--- .../core/addtional}/clash-meta-client.nix | 2 +- .../core/addtional}/hysteria2-server.nix | 2 +- .../core/addtional}/juicity-server.nix | 2 +- .../core.nix => profiles/core/default.nix} | 21 ++++--- .../profiles/desktop/addtional}/gaming.nix | 2 +- .../desktop/addtional}/torrenting.nix | 2 +- .../desktop/default.nix} | 45 ++++++++------ 103 files changed, 202 insertions(+), 219 deletions(-) rename {flakes/darwin => darwin/flake-modules}/home-manager.nix (100%) rename {machines/darwin => darwin/hardware}/imac-2017/default.nix (100%) rename {machines/darwin => darwin/hardware}/imac-2017/hardware.nix (100%) create mode 100644 darwin/modules/default.nix rename darwin/{ => modules}/networking/default.nix (100%) mode change 100644 => 100755 create mode 100644 darwin/modules/networking/dns.nix delete mode 100644 darwin/networking/dns.nix delete mode 100644 darwin/presets/desktop.nix rename darwin/{presets/desktop => profiles/desktop/addtional}/gaming.nix (100%) create mode 100644 darwin/profiles/desktop/default.nix rename darwin/{ => profiles/desktop}/nix/default.nix (100%) rename darwin/{ => profiles/desktop}/nix/flake.nix (100%) rename darwin/{ => profiles/desktop}/nix/gc.nix (100%) rename darwin/{ => profiles/desktop}/nix/nix.nix (100%) rename darwin/{ => profiles/desktop}/packages/core.nix (100%) rename darwin/{ => profiles/desktop}/packages/default.nix (100%) rename darwin/{ => profiles/desktop}/packages/fonts.nix (100%) rename darwin/{ => profiles/desktop}/packages/homebrew.nix (100%) rename darwin/{ => profiles/desktop}/packages/unfree.nix (100%) rename darwin/{ => profiles/desktop}/system/default.nix (100%) rename darwin/{ => profiles/desktop}/system/system.nix (100%) delete mode 100644 machines/nixos/81fw-lenovo-legion-y7000/Aristotle/default.nix rename {flakes/nixos => nixos/flake-modules}/berberman.nix (100%) rename {flakes/nixos => nixos/flake-modules}/disko.nix (100%) rename {flakes/nixos => nixos/flake-modules}/home-manager.nix (100%) rename {flakes/nixos => nixos/flake-modules}/hosts.nix (100%) rename {flakes/nixos => nixos/flake-modules}/hyprland.nix (100%) rename {flakes/nixos => nixos/flake-modules}/impermanence.nix (100%) rename {flakes/nixos => nixos/flake-modules}/lanzaboote.nix (100%) rename {flakes/nixos => nixos/flake-modules}/sops-nix.nix (100%) create mode 100644 nixos/hardware/81fw-lenovo-legion-y7000/Aristotle/default.nix rename {machines/nixos => nixos/hardware}/81fw-lenovo-legion-y7000/default.nix (100%) rename {machines/nixos => nixos/hardware}/81fw-lenovo-legion-y7000/hardware.nix (100%) rename {machines/nixos => nixos/hardware}/hardware/cpu/intel.nix (100%) rename {machines/nixos => nixos/hardware}/hardware/gpu/amd.nix (100%) rename {machines/nixos => nixos/hardware}/hardware/gpu/intel.nix (100%) rename {machines/nixos => nixos/hardware}/hardware/gpu/nvidia-prime.nix (100%) rename {machines/nixos => nixos/hardware}/hardware/gpu/nvidia.nix (100%) rename {machines/nixos => nixos/hardware}/hardware/misc/audio.nix (100%) rename {machines/nixos => nixos/hardware}/hardware/misc/bluetooth.nix (100%) rename {machines/nixos => nixos/hardware}/hardware/misc/opengl.nix (100%) rename {machines/nixos => nixos/hardware}/hardware/misc/tpm.nix (100%) rename {machines/nixos => nixos/hardware}/imac-2017/default.nix (100%) rename {machines/nixos => nixos/hardware}/imac-2017/hardware.nix (100%) rename nixos/{ => modules}/boot/boot.nix (100%) rename nixos/{ => modules}/boot/default.nix (72%) create mode 100644 nixos/modules/default.nix rename nixos/{ => modules}/networking/default.nix (100%) rename nixos/{ => modules}/networking/dns.nix (100%) rename nixos/{ => modules}/networking/network-configuration-daemon.nix (100%) rename nixos/{presets/core => profiles/core/addtional}/boot/legacy-boot.nix (100%) rename nixos/{presets/core => profiles/core/addtional}/networking/systemd-resolved.nix (100%) rename nixos/{presets/core => profiles/core/addtional}/zram-generator.nix (100%) rename nixos/{presets/core.nix => profiles/core/default.nix} (90%) mode change 100755 => 100644 rename nixos/{ => profiles/core}/nix/default.nix (100%) rename nixos/{ => profiles/core}/nix/flake.nix (100%) rename nixos/{ => profiles/core}/nix/gc.nix (100%) rename nixos/{ => profiles/core}/nix/nix.nix (100%) rename nixos/{ => profiles/core}/packages/anti-feature.nix (100%) rename nixos/{ => profiles/core}/packages/default.nix (100%) rename nixos/{ => profiles/core}/packages/hardware.nix (100%) rename nixos/{ => profiles/core}/packages/overlays/default.nix (100%) rename nixos/{ => profiles/core}/packages/overlays/firefox.nix (100%) rename nixos/{ => profiles/core}/packages/overlays/nautilus.nix (100%) rename nixos/{ => profiles/core}/packages/overlays/prismlauncher.nix (100%) rename nixos/{ => profiles/core}/packages/overlays/sway.nix (100%) rename nixos/{boot => profiles/core}/sysctl.nix (100%) rename nixos/{presets/desktop => profiles/desktop/addtional}/accessories/logitech.nix (100%) rename nixos/{presets/desktop => profiles/desktop/addtional}/accessories/xbox.nix (100%) rename nixos/{presets/desktop => profiles/desktop/addtional}/flatpak.nix (100%) rename nixos/{presets/desktop => profiles/desktop/addtional}/gaming.nix (100%) rename nixos/{presets/desktop => profiles/desktop/addtional}/virt-manager.nix (100%) rename nixos/{presets/desktop => profiles/desktop/addtional}/virtualbox.nix (100%) rename nixos/{presets/desktop => profiles/desktop/addtional}/wayland.nix (100%) rename nixos/{presets/desktop.nix => profiles/desktop/default.nix} (69%) rename nixos/{packages => profiles/desktop}/graphical/default.nix (100%) rename nixos/{packages => profiles/desktop}/graphical/display-server.nix (100%) rename nixos/{packages => profiles/desktop}/graphical/gnome-keyring.nix (100%) rename nixos/{packages => profiles/desktop}/graphical/polkit.nix (100%) rename nixos/{ => profiles/desktop}/power-management/cpu-governor.nix (100%) rename nixos/{ => profiles/desktop}/power-management/default.nix (100%) rename nixos/{ => profiles/desktop}/power-management/power-profiles-daemon.nix (100%) rename nixos/{ => profiles/desktop}/power-management/system76-scheduler.nix (100%) rename nixos/{ => profiles/desktop}/power-management/tlp.nix (100%) rename nixos/{presets/server.nix => profiles/server/default.nix} (88%) mode change 100755 => 100644 delete mode 100644 nixos/specialisation/default.nix delete mode 100644 users/guanranwang/darwin/presets/core.nix delete mode 100644 users/guanranwang/darwin/presets/desktop.nix rename users/guanranwang/darwin/{presets/core/proxy.nix => profiles/core/addtional/networking/clash-meta-client.nix} (100%) create mode 100644 users/guanranwang/darwin/profiles/core/default.nix rename users/guanranwang/{nixos/presets/desktop => darwin/profiles/desktop/addtional/misc}/gaming.nix (52%) create mode 100644 users/guanranwang/darwin/profiles/desktop/default.nix rename users/guanranwang/home-manager/profiles/graphical-stuff/darwin/{home.nix => default.nix} (100%) rename users/guanranwang/nixos/{presets/core => profiles/core/addtional}/clash-meta-client.nix (97%) rename users/guanranwang/nixos/{presets/core => profiles/core/addtional}/hysteria2-server.nix (96%) rename users/guanranwang/nixos/{presets/core => profiles/core/addtional}/juicity-server.nix (96%) rename users/guanranwang/nixos/{presets/core.nix => profiles/core/default.nix} (71%) rename users/guanranwang/{darwin/presets/desktop => nixos/profiles/desktop/addtional}/gaming.nix (54%) rename users/guanranwang/nixos/{presets/desktop => profiles/desktop/addtional}/torrenting.nix (52%) rename users/guanranwang/nixos/{presets/desktop.nix => profiles/desktop/default.nix} (55%) diff --git a/README.md b/README.md index 51192e3..6eb78d1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ It just works™ - Flakes: Yes - Home Manager: Yes -### Machine-specific (81fw-nixos) +### Machine-specific (Aristotle) - File system: Btrfs - System encryption: Yes (LUKS) @@ -18,34 +18,21 @@ It just works™ ## Structure ```  . -├──  darwin # System configuration +│ ### System configuration +├──  darwin ├──  nixos +│ ├──  flake-modules +│ ├──  hardware +│ ├──  modules +│ └──  profiles │ -├──  flakes # Import-able Flakes -│ ├──  darwin -│ └──  nixos -│ -├──  machines # Hardware configuration -│ ├──  darwin -│ └──  nixos -│ ├──  81fw-lenovo-legion-y7000 ### Model -│ │ ├──  hardware.nix #### Model-specific hardware configuration -│ │ └──  machine-1 #### Machine-specific hardware configuration -│ │ -│ └───  hardware ### Reusable hardware configuration -│ ├──  cpu -│ ├──  gpu -│ └──  ... -│ +│ ### User configuration +│ # Adds user account, home-manager stuff, etc. +│ # Do whatever you want here. ├──  users -│ └──  guanranwang ## Your user -│ │ -│ ├──  darwin ### (User-specific) System configuration -│ ├──  nixos -│ │ -│ ├──  home-manager ### (User-specific) Home Manager configuration -│ │ -│ └──  secrets ### User's secrets managed through sops-nix +│ ├──  guanranwang +│ ├──  foo +│ └──  bar │ ├──  flake.nix ├──  flake.lock @@ -61,7 +48,7 @@ It just works™ `$ git clone https://github.com/Guanran928/flake.git` 2. - Add your device's hardware configuration in `./machines` and `./flake.nix` + Add your device's hardware configuration in `./ (nixos/darwin) /hardware` and `./flake.nix` 3. Install NixOS diff --git a/flakes/darwin/home-manager.nix b/darwin/flake-modules/home-manager.nix similarity index 100% rename from flakes/darwin/home-manager.nix rename to darwin/flake-modules/home-manager.nix diff --git a/machines/darwin/imac-2017/default.nix b/darwin/hardware/imac-2017/default.nix similarity index 100% rename from machines/darwin/imac-2017/default.nix rename to darwin/hardware/imac-2017/default.nix diff --git a/machines/darwin/imac-2017/hardware.nix b/darwin/hardware/imac-2017/hardware.nix similarity index 100% rename from machines/darwin/imac-2017/hardware.nix rename to darwin/hardware/imac-2017/hardware.nix diff --git a/darwin/modules/default.nix b/darwin/modules/default.nix new file mode 100644 index 0000000..4245435 --- /dev/null +++ b/darwin/modules/default.nix @@ -0,0 +1,5 @@ +{...}: { + imports = [ + ./networking + ]; +} diff --git a/darwin/networking/default.nix b/darwin/modules/networking/default.nix old mode 100644 new mode 100755 similarity index 100% rename from darwin/networking/default.nix rename to darwin/modules/networking/default.nix diff --git a/darwin/modules/networking/dns.nix b/darwin/modules/networking/dns.nix new file mode 100644 index 0000000..b89815e --- /dev/null +++ b/darwin/modules/networking/dns.nix @@ -0,0 +1,29 @@ +{ + lib, + config, + ... +}: { + options.myFlake.darwin.networking.dns = lib.mkOption { + type = lib.types.enum ["google" "alidns"]; + default = "google"; + example = "alidns"; + description = "Select your DNS provider"; + }; + + config.networking.dns = lib.mkMerge [ + (lib.mkIf (config.myFlake.darwin.networking.dns == "google") [ + ### Google DNS + "8.8.8.8" + "8.8.4.4" + "2001:4860:4860::8888" + "2001:4860:4860::8844" + ]) + (lib.mkIf (config.myFlake.darwin.networking.dns == "alidns") [ + ### AliDNS + "223.5.5.5" + "223.6.6.6" + "2400:3200::1" + "2400:3200:baba::1" + ]) + ]; +} diff --git a/darwin/networking/dns.nix b/darwin/networking/dns.nix deleted file mode 100644 index e188b5c..0000000 --- a/darwin/networking/dns.nix +++ /dev/null @@ -1,17 +0,0 @@ -{...}: { - # please configure `networking.knownNetworkServices` in ../hosts/your-machine.nix - networking.dns = [ - "223.5.5.5" - "223.6.6.6" - "2400:3200::1" - "2400:3200:baba::1" - #"223.5.5.5#dns.alidns.com" - #"223.6.6.6#dns.alidns.com" - #"2400:3200::1#dns.alidns.com" - #"2400:3200:baba::1#dns.alidns.com" - #"8.8.8.8" - #"8.8.4.4" - #"2001:4860:4860::8888" - #"2001:4860:4860::8844" - ]; -} diff --git a/darwin/presets/desktop.nix b/darwin/presets/desktop.nix deleted file mode 100644 index 4d21473..0000000 --- a/darwin/presets/desktop.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - imports = [ - ../networking - ../nix - ../packages - ../system - ]; -} diff --git a/darwin/presets/desktop/gaming.nix b/darwin/profiles/desktop/addtional/gaming.nix similarity index 100% rename from darwin/presets/desktop/gaming.nix rename to darwin/profiles/desktop/addtional/gaming.nix diff --git a/darwin/profiles/desktop/default.nix b/darwin/profiles/desktop/default.nix new file mode 100644 index 0000000..6ef2a74 --- /dev/null +++ b/darwin/profiles/desktop/default.nix @@ -0,0 +1,9 @@ +{...}: { + imports = [ + ../../modules + + ./nix + ./packages + ./system + ]; +} diff --git a/darwin/nix/default.nix b/darwin/profiles/desktop/nix/default.nix similarity index 100% rename from darwin/nix/default.nix rename to darwin/profiles/desktop/nix/default.nix diff --git a/darwin/nix/flake.nix b/darwin/profiles/desktop/nix/flake.nix similarity index 100% rename from darwin/nix/flake.nix rename to darwin/profiles/desktop/nix/flake.nix diff --git a/darwin/nix/gc.nix b/darwin/profiles/desktop/nix/gc.nix similarity index 100% rename from darwin/nix/gc.nix rename to darwin/profiles/desktop/nix/gc.nix diff --git a/darwin/nix/nix.nix b/darwin/profiles/desktop/nix/nix.nix similarity index 100% rename from darwin/nix/nix.nix rename to darwin/profiles/desktop/nix/nix.nix diff --git a/darwin/packages/core.nix b/darwin/profiles/desktop/packages/core.nix similarity index 100% rename from darwin/packages/core.nix rename to darwin/profiles/desktop/packages/core.nix diff --git a/darwin/packages/default.nix b/darwin/profiles/desktop/packages/default.nix similarity index 100% rename from darwin/packages/default.nix rename to darwin/profiles/desktop/packages/default.nix diff --git a/darwin/packages/fonts.nix b/darwin/profiles/desktop/packages/fonts.nix similarity index 100% rename from darwin/packages/fonts.nix rename to darwin/profiles/desktop/packages/fonts.nix diff --git a/darwin/packages/homebrew.nix b/darwin/profiles/desktop/packages/homebrew.nix similarity index 100% rename from darwin/packages/homebrew.nix rename to darwin/profiles/desktop/packages/homebrew.nix diff --git a/darwin/packages/unfree.nix b/darwin/profiles/desktop/packages/unfree.nix similarity index 100% rename from darwin/packages/unfree.nix rename to darwin/profiles/desktop/packages/unfree.nix diff --git a/darwin/system/default.nix b/darwin/profiles/desktop/system/default.nix similarity index 100% rename from darwin/system/default.nix rename to darwin/profiles/desktop/system/default.nix diff --git a/darwin/system/system.nix b/darwin/profiles/desktop/system/system.nix similarity index 100% rename from darwin/system/system.nix rename to darwin/profiles/desktop/system/system.nix diff --git a/flake.nix b/flake.nix index db8c33d..b518490 100755 --- a/flake.nix +++ b/flake.nix @@ -188,64 +188,43 @@ specialArgs = {inherit inputs;}; modules = [ # OS - ./nixos/presets/desktop.nix - ./nixos/presets/core/zram-generator.nix - ./nixos/presets/desktop/gaming.nix - ./nixos/presets/desktop/virtualbox.nix - ./nixos/presets/desktop/wayland.nix - ./nixos/presets/desktop/virt-manager.nix + ./nixos/profiles/desktop + ./nixos/profiles/core/addtional/zram-generator.nix + ./nixos/profiles/desktop/addtional/gaming.nix + ./nixos/profiles/desktop/addtional/virtualbox.nix + ./nixos/profiles/desktop/addtional/wayland.nix + ./nixos/profiles/desktop/addtional/virt-manager.nix # User - ./users/guanranwang/nixos/presets/desktop.nix - ./users/guanranwang/nixos/presets/core/clash-meta-client.nix - ./users/guanranwang/nixos/presets/desktop/gaming.nix - ./users/guanranwang/nixos/presets/desktop/torrenting.nix + ./users/guanranwang/nixos/profiles/desktop + ./users/guanranwang/nixos/profiles/core/addtional/clash-meta-client.nix + ./users/guanranwang/nixos/profiles/desktop/addtional/gaming.nix + ./users/guanranwang/nixos/profiles/desktop/addtional/torrenting.nix # Hardware - ./machines/nixos/81fw-lenovo-legion-y7000 - ./machines/nixos/81fw-lenovo-legion-y7000/Aristotle + ./nixos/hardware/81fw-lenovo-legion-y7000/Aristotle - { - networking.hostName = "Aristotle"; # Hostname - time.timeZone = "Asia/Shanghai"; # Timezone - - ### Options - myFlake.nixos.boot.noLoaderMenu = true; - myFlake.nixos.networking.dns = "alidns"; - } + {networking.hostName = "Aristotle";} ]; }; }; - ### nix-darwin + ### Darwin darwinConfigurations = { "Plato" = nix-darwin.lib.darwinSystem { system = "x86_64-darwin"; specialArgs = {inherit inputs;}; modules = [ - ./darwin/presets/desktop.nix - ./users/guanranwang/darwin/presets/desktop.nix - ./users/guanranwang/darwin/presets/core/proxy.nix - ./machines/darwin/imac-2017 + ./darwin/profiles/desktop - { - networking.hostName = "Plato"; - time.timeZone = "Asia/Shanghai"; - } + ./users/guanranwang/darwin/profiles/desktop + ./users/guanranwang/darwin/profiles/core/addtional/networking/clash-meta-client.nix + + ./darwin/hardware/imac-2017 + + {networking.hostName = "Plato";} ]; }; }; - - ### Standalone Home-Manager - #homeConfigurations = { - # "guanranwang@81fw-nixos" = home-manager.lib.homeManagerConfiguration { - # pkgs = nixpkgs.legacyPackages.x86_64-linux; - # extraSpecialArgs = {inherit inputs;}; - # modules = [ - # sops-nix.homeManagerModules.sops - # hyprland.homeManagerModules.default - # ]; - # }; - #}; }; } diff --git a/machines/nixos/81fw-lenovo-legion-y7000/Aristotle/default.nix b/machines/nixos/81fw-lenovo-legion-y7000/Aristotle/default.nix deleted file mode 100644 index 772d62b..0000000 --- a/machines/nixos/81fw-lenovo-legion-y7000/Aristotle/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - imports = [ - ../../../../flakes/nixos/lanzaboote.nix - ../../../../flakes/nixos/impermanence.nix - ../../../../flakes/nixos/disko.nix - ]; - - _module.args.disks = ["/dev/nvme0n1"]; # Disko - boot.initrd.systemd.enable = true; # LUKS TPM unlocking -} diff --git a/flakes/nixos/berberman.nix b/nixos/flake-modules/berberman.nix similarity index 100% rename from flakes/nixos/berberman.nix rename to nixos/flake-modules/berberman.nix diff --git a/flakes/nixos/disko.nix b/nixos/flake-modules/disko.nix similarity index 100% rename from flakes/nixos/disko.nix rename to nixos/flake-modules/disko.nix diff --git a/flakes/nixos/home-manager.nix b/nixos/flake-modules/home-manager.nix similarity index 100% rename from flakes/nixos/home-manager.nix rename to nixos/flake-modules/home-manager.nix diff --git a/flakes/nixos/hosts.nix b/nixos/flake-modules/hosts.nix similarity index 100% rename from flakes/nixos/hosts.nix rename to nixos/flake-modules/hosts.nix diff --git a/flakes/nixos/hyprland.nix b/nixos/flake-modules/hyprland.nix similarity index 100% rename from flakes/nixos/hyprland.nix rename to nixos/flake-modules/hyprland.nix diff --git a/flakes/nixos/impermanence.nix b/nixos/flake-modules/impermanence.nix similarity index 100% rename from flakes/nixos/impermanence.nix rename to nixos/flake-modules/impermanence.nix diff --git a/flakes/nixos/lanzaboote.nix b/nixos/flake-modules/lanzaboote.nix similarity index 100% rename from flakes/nixos/lanzaboote.nix rename to nixos/flake-modules/lanzaboote.nix diff --git a/flakes/nixos/sops-nix.nix b/nixos/flake-modules/sops-nix.nix similarity index 100% rename from flakes/nixos/sops-nix.nix rename to nixos/flake-modules/sops-nix.nix diff --git a/nixos/hardware/81fw-lenovo-legion-y7000/Aristotle/default.nix b/nixos/hardware/81fw-lenovo-legion-y7000/Aristotle/default.nix new file mode 100644 index 0000000..9b9c569 --- /dev/null +++ b/nixos/hardware/81fw-lenovo-legion-y7000/Aristotle/default.nix @@ -0,0 +1,11 @@ +{...}: { + imports = [ + ../default.nix + ../../../../nixos/flake-modules/lanzaboote.nix + ../../../../nixos/flake-modules/impermanence.nix + ../../../../nixos/flake-modules/disko.nix + ]; + + _module.args.disks = ["/dev/nvme0n1"]; # Disko + boot.initrd.systemd.enable = true; # LUKS TPM unlocking +} diff --git a/machines/nixos/81fw-lenovo-legion-y7000/default.nix b/nixos/hardware/81fw-lenovo-legion-y7000/default.nix similarity index 100% rename from machines/nixos/81fw-lenovo-legion-y7000/default.nix rename to nixos/hardware/81fw-lenovo-legion-y7000/default.nix diff --git a/machines/nixos/81fw-lenovo-legion-y7000/hardware.nix b/nixos/hardware/81fw-lenovo-legion-y7000/hardware.nix similarity index 100% rename from machines/nixos/81fw-lenovo-legion-y7000/hardware.nix rename to nixos/hardware/81fw-lenovo-legion-y7000/hardware.nix diff --git a/machines/nixos/hardware/cpu/intel.nix b/nixos/hardware/hardware/cpu/intel.nix similarity index 100% rename from machines/nixos/hardware/cpu/intel.nix rename to nixos/hardware/hardware/cpu/intel.nix diff --git a/machines/nixos/hardware/gpu/amd.nix b/nixos/hardware/hardware/gpu/amd.nix similarity index 100% rename from machines/nixos/hardware/gpu/amd.nix rename to nixos/hardware/hardware/gpu/amd.nix diff --git a/machines/nixos/hardware/gpu/intel.nix b/nixos/hardware/hardware/gpu/intel.nix similarity index 100% rename from machines/nixos/hardware/gpu/intel.nix rename to nixos/hardware/hardware/gpu/intel.nix diff --git a/machines/nixos/hardware/gpu/nvidia-prime.nix b/nixos/hardware/hardware/gpu/nvidia-prime.nix similarity index 100% rename from machines/nixos/hardware/gpu/nvidia-prime.nix rename to nixos/hardware/hardware/gpu/nvidia-prime.nix diff --git a/machines/nixos/hardware/gpu/nvidia.nix b/nixos/hardware/hardware/gpu/nvidia.nix similarity index 100% rename from machines/nixos/hardware/gpu/nvidia.nix rename to nixos/hardware/hardware/gpu/nvidia.nix diff --git a/machines/nixos/hardware/misc/audio.nix b/nixos/hardware/hardware/misc/audio.nix similarity index 100% rename from machines/nixos/hardware/misc/audio.nix rename to nixos/hardware/hardware/misc/audio.nix diff --git a/machines/nixos/hardware/misc/bluetooth.nix b/nixos/hardware/hardware/misc/bluetooth.nix similarity index 100% rename from machines/nixos/hardware/misc/bluetooth.nix rename to nixos/hardware/hardware/misc/bluetooth.nix diff --git a/machines/nixos/hardware/misc/opengl.nix b/nixos/hardware/hardware/misc/opengl.nix similarity index 100% rename from machines/nixos/hardware/misc/opengl.nix rename to nixos/hardware/hardware/misc/opengl.nix diff --git a/machines/nixos/hardware/misc/tpm.nix b/nixos/hardware/hardware/misc/tpm.nix similarity index 100% rename from machines/nixos/hardware/misc/tpm.nix rename to nixos/hardware/hardware/misc/tpm.nix diff --git a/machines/nixos/imac-2017/default.nix b/nixos/hardware/imac-2017/default.nix similarity index 100% rename from machines/nixos/imac-2017/default.nix rename to nixos/hardware/imac-2017/default.nix diff --git a/machines/nixos/imac-2017/hardware.nix b/nixos/hardware/imac-2017/hardware.nix similarity index 100% rename from machines/nixos/imac-2017/hardware.nix rename to nixos/hardware/imac-2017/hardware.nix diff --git a/nixos/boot/boot.nix b/nixos/modules/boot/boot.nix similarity index 100% rename from nixos/boot/boot.nix rename to nixos/modules/boot/boot.nix diff --git a/nixos/boot/default.nix b/nixos/modules/boot/default.nix similarity index 72% rename from nixos/boot/default.nix rename to nixos/modules/boot/default.nix index f6ae6be..99a4a16 100644 --- a/nixos/boot/default.nix +++ b/nixos/modules/boot/default.nix @@ -1,6 +1,5 @@ {...}: { imports = [ ./boot.nix - ./sysctl.nix ]; } diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix new file mode 100644 index 0000000..9bc08ec --- /dev/null +++ b/nixos/modules/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./boot + ./networking + ]; +} diff --git a/nixos/networking/default.nix b/nixos/modules/networking/default.nix similarity index 100% rename from nixos/networking/default.nix rename to nixos/modules/networking/default.nix diff --git a/nixos/networking/dns.nix b/nixos/modules/networking/dns.nix similarity index 100% rename from nixos/networking/dns.nix rename to nixos/modules/networking/dns.nix diff --git a/nixos/networking/network-configuration-daemon.nix b/nixos/modules/networking/network-configuration-daemon.nix similarity index 100% rename from nixos/networking/network-configuration-daemon.nix rename to nixos/modules/networking/network-configuration-daemon.nix diff --git a/nixos/presets/core/boot/legacy-boot.nix b/nixos/profiles/core/addtional/boot/legacy-boot.nix similarity index 100% rename from nixos/presets/core/boot/legacy-boot.nix rename to nixos/profiles/core/addtional/boot/legacy-boot.nix diff --git a/nixos/presets/core/networking/systemd-resolved.nix b/nixos/profiles/core/addtional/networking/systemd-resolved.nix similarity index 100% rename from nixos/presets/core/networking/systemd-resolved.nix rename to nixos/profiles/core/addtional/networking/systemd-resolved.nix diff --git a/nixos/presets/core/zram-generator.nix b/nixos/profiles/core/addtional/zram-generator.nix similarity index 100% rename from nixos/presets/core/zram-generator.nix rename to nixos/profiles/core/addtional/zram-generator.nix diff --git a/nixos/presets/core.nix b/nixos/profiles/core/default.nix old mode 100755 new mode 100644 similarity index 90% rename from nixos/presets/core.nix rename to nixos/profiles/core/default.nix index 63996a9..ad4bc77 --- a/nixos/presets/core.nix +++ b/nixos/profiles/core/default.nix @@ -1,13 +1,11 @@ -{config, ...}: -# Imported by default, check out ./desktop.nix or ./server.nix -{ +{config, ...}: { + # Imported by default, check out ./desktop.nix or ./server.nix imports = [ - ../boot - ../networking - ../nix - ../packages - ../power-management - #../specialisation # dont actually use this + ../../modules # idk where should i import it + + ./nix + ./packages + ./sysctl.nix ]; users.mutableUsers = false; diff --git a/nixos/nix/default.nix b/nixos/profiles/core/nix/default.nix similarity index 100% rename from nixos/nix/default.nix rename to nixos/profiles/core/nix/default.nix diff --git a/nixos/nix/flake.nix b/nixos/profiles/core/nix/flake.nix similarity index 100% rename from nixos/nix/flake.nix rename to nixos/profiles/core/nix/flake.nix diff --git a/nixos/nix/gc.nix b/nixos/profiles/core/nix/gc.nix similarity index 100% rename from nixos/nix/gc.nix rename to nixos/profiles/core/nix/gc.nix diff --git a/nixos/nix/nix.nix b/nixos/profiles/core/nix/nix.nix similarity index 100% rename from nixos/nix/nix.nix rename to nixos/profiles/core/nix/nix.nix diff --git a/nixos/packages/anti-feature.nix b/nixos/profiles/core/packages/anti-feature.nix similarity index 100% rename from nixos/packages/anti-feature.nix rename to nixos/profiles/core/packages/anti-feature.nix diff --git a/nixos/packages/default.nix b/nixos/profiles/core/packages/default.nix similarity index 100% rename from nixos/packages/default.nix rename to nixos/profiles/core/packages/default.nix diff --git a/nixos/packages/hardware.nix b/nixos/profiles/core/packages/hardware.nix similarity index 100% rename from nixos/packages/hardware.nix rename to nixos/profiles/core/packages/hardware.nix diff --git a/nixos/packages/overlays/default.nix b/nixos/profiles/core/packages/overlays/default.nix similarity index 100% rename from nixos/packages/overlays/default.nix rename to nixos/profiles/core/packages/overlays/default.nix diff --git a/nixos/packages/overlays/firefox.nix b/nixos/profiles/core/packages/overlays/firefox.nix similarity index 100% rename from nixos/packages/overlays/firefox.nix rename to nixos/profiles/core/packages/overlays/firefox.nix diff --git a/nixos/packages/overlays/nautilus.nix b/nixos/profiles/core/packages/overlays/nautilus.nix similarity index 100% rename from nixos/packages/overlays/nautilus.nix rename to nixos/profiles/core/packages/overlays/nautilus.nix diff --git a/nixos/packages/overlays/prismlauncher.nix b/nixos/profiles/core/packages/overlays/prismlauncher.nix similarity index 100% rename from nixos/packages/overlays/prismlauncher.nix rename to nixos/profiles/core/packages/overlays/prismlauncher.nix diff --git a/nixos/packages/overlays/sway.nix b/nixos/profiles/core/packages/overlays/sway.nix similarity index 100% rename from nixos/packages/overlays/sway.nix rename to nixos/profiles/core/packages/overlays/sway.nix diff --git a/nixos/boot/sysctl.nix b/nixos/profiles/core/sysctl.nix similarity index 100% rename from nixos/boot/sysctl.nix rename to nixos/profiles/core/sysctl.nix diff --git a/nixos/presets/desktop/accessories/logitech.nix b/nixos/profiles/desktop/addtional/accessories/logitech.nix similarity index 100% rename from nixos/presets/desktop/accessories/logitech.nix rename to nixos/profiles/desktop/addtional/accessories/logitech.nix diff --git a/nixos/presets/desktop/accessories/xbox.nix b/nixos/profiles/desktop/addtional/accessories/xbox.nix similarity index 100% rename from nixos/presets/desktop/accessories/xbox.nix rename to nixos/profiles/desktop/addtional/accessories/xbox.nix diff --git a/nixos/presets/desktop/flatpak.nix b/nixos/profiles/desktop/addtional/flatpak.nix similarity index 100% rename from nixos/presets/desktop/flatpak.nix rename to nixos/profiles/desktop/addtional/flatpak.nix diff --git a/nixos/presets/desktop/gaming.nix b/nixos/profiles/desktop/addtional/gaming.nix similarity index 100% rename from nixos/presets/desktop/gaming.nix rename to nixos/profiles/desktop/addtional/gaming.nix diff --git a/nixos/presets/desktop/virt-manager.nix b/nixos/profiles/desktop/addtional/virt-manager.nix similarity index 100% rename from nixos/presets/desktop/virt-manager.nix rename to nixos/profiles/desktop/addtional/virt-manager.nix diff --git a/nixos/presets/desktop/virtualbox.nix b/nixos/profiles/desktop/addtional/virtualbox.nix similarity index 100% rename from nixos/presets/desktop/virtualbox.nix rename to nixos/profiles/desktop/addtional/virtualbox.nix diff --git a/nixos/presets/desktop/wayland.nix b/nixos/profiles/desktop/addtional/wayland.nix similarity index 100% rename from nixos/presets/desktop/wayland.nix rename to nixos/profiles/desktop/addtional/wayland.nix diff --git a/nixos/presets/desktop.nix b/nixos/profiles/desktop/default.nix similarity index 69% rename from nixos/presets/desktop.nix rename to nixos/profiles/desktop/default.nix index fb1024c..4a3fd8f 100644 --- a/nixos/presets/desktop.nix +++ b/nixos/profiles/desktop/default.nix @@ -1,7 +1,9 @@ {pkgs, ...}: { imports = [ - ./core.nix - ../packages/graphical + ../core + + ./power-management + ./graphical ]; boot.kernelPackages = pkgs.linuxPackages_zen; diff --git a/nixos/packages/graphical/default.nix b/nixos/profiles/desktop/graphical/default.nix similarity index 100% rename from nixos/packages/graphical/default.nix rename to nixos/profiles/desktop/graphical/default.nix diff --git a/nixos/packages/graphical/display-server.nix b/nixos/profiles/desktop/graphical/display-server.nix similarity index 100% rename from nixos/packages/graphical/display-server.nix rename to nixos/profiles/desktop/graphical/display-server.nix diff --git a/nixos/packages/graphical/gnome-keyring.nix b/nixos/profiles/desktop/graphical/gnome-keyring.nix similarity index 100% rename from nixos/packages/graphical/gnome-keyring.nix rename to nixos/profiles/desktop/graphical/gnome-keyring.nix diff --git a/nixos/packages/graphical/polkit.nix b/nixos/profiles/desktop/graphical/polkit.nix similarity index 100% rename from nixos/packages/graphical/polkit.nix rename to nixos/profiles/desktop/graphical/polkit.nix diff --git a/nixos/power-management/cpu-governor.nix b/nixos/profiles/desktop/power-management/cpu-governor.nix similarity index 100% rename from nixos/power-management/cpu-governor.nix rename to nixos/profiles/desktop/power-management/cpu-governor.nix diff --git a/nixos/power-management/default.nix b/nixos/profiles/desktop/power-management/default.nix similarity index 100% rename from nixos/power-management/default.nix rename to nixos/profiles/desktop/power-management/default.nix diff --git a/nixos/power-management/power-profiles-daemon.nix b/nixos/profiles/desktop/power-management/power-profiles-daemon.nix similarity index 100% rename from nixos/power-management/power-profiles-daemon.nix rename to nixos/profiles/desktop/power-management/power-profiles-daemon.nix diff --git a/nixos/power-management/system76-scheduler.nix b/nixos/profiles/desktop/power-management/system76-scheduler.nix similarity index 100% rename from nixos/power-management/system76-scheduler.nix rename to nixos/profiles/desktop/power-management/system76-scheduler.nix diff --git a/nixos/power-management/tlp.nix b/nixos/profiles/desktop/power-management/tlp.nix similarity index 100% rename from nixos/power-management/tlp.nix rename to nixos/profiles/desktop/power-management/tlp.nix diff --git a/nixos/presets/server.nix b/nixos/profiles/server/default.nix old mode 100755 new mode 100644 similarity index 88% rename from nixos/presets/server.nix rename to nixos/profiles/server/default.nix index 68211d5..8430781 --- a/nixos/presets/server.nix +++ b/nixos/profiles/server/default.nix @@ -3,6 +3,6 @@ { imports = [ (modulesPath + "/profiles/minimal.nix") - ./core.nix + ../core ]; } diff --git a/nixos/specialisation/default.nix b/nixos/specialisation/default.nix deleted file mode 100644 index 4e1fa54..0000000 --- a/nixos/specialisation/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{...}: { - specialisation = { - bspwm.configuration = { - system.nixos.tags = ["bspwm"]; - services.xserver = { - displayManager.startx.enable = true; - windowManager.bspwm.enable = true; - }; - }; - plasma.configuration = { - system.nixos.tags = ["plasma"]; - services.xserver = { - desktopManager.plasma5.enable = true; - displayManager.sddm = { - enable = true; - settings.General.DisplayServer = "wayland"; - }; - }; - }; - }; -} diff --git a/users/guanranwang/darwin/presets/core.nix b/users/guanranwang/darwin/presets/core.nix deleted file mode 100644 index 8600731..0000000 --- a/users/guanranwang/darwin/presets/core.nix +++ /dev/null @@ -1,21 +0,0 @@ -{pkgs, ...}: { - users = { - knownUsers = ["guanranwang"]; - users."guanranwang" = { - createHome = true; - description = "Guanran Wang"; - home = "/Users/guanranwang"; - shell = pkgs.fish; - uid = 501; - }; - }; - - imports = [ - ../../../../flakes/darwin/home-manager.nix - ]; - - home-manager.users.guanranwang.imports = [ - ../.. - ../../profiles/command-line/darwin - ]; -} diff --git a/users/guanranwang/darwin/presets/desktop.nix b/users/guanranwang/darwin/presets/desktop.nix deleted file mode 100644 index a7a8b68..0000000 --- a/users/guanranwang/darwin/presets/desktop.nix +++ /dev/null @@ -1,19 +0,0 @@ -{...}: { - imports = [ - ./core.nix - ]; - - ### home-manager - home-manager.users.guanranwang.imports = [ - ./core.nix - - ../../modules/terms/alacritty.nix - ../../modules/shell/fish.nix - ../../modules/shell/bash.nix - ../../modules/editor/helix.nix - ../../modules/editor/neovim.nix - ../../modules/editor/vscode.nix - - ../home.nix - ]; # NOTE: using flakes -} diff --git a/users/guanranwang/darwin/presets/core/proxy.nix b/users/guanranwang/darwin/profiles/core/addtional/networking/clash-meta-client.nix similarity index 100% rename from users/guanranwang/darwin/presets/core/proxy.nix rename to users/guanranwang/darwin/profiles/core/addtional/networking/clash-meta-client.nix diff --git a/users/guanranwang/darwin/profiles/core/default.nix b/users/guanranwang/darwin/profiles/core/default.nix new file mode 100644 index 0000000..fbe3d7d --- /dev/null +++ b/users/guanranwang/darwin/profiles/core/default.nix @@ -0,0 +1,31 @@ +{ + pkgs, + lib, + ... +}: { + users = { + knownUsers = ["guanranwang"]; + users."guanranwang" = { + createHome = true; + description = "Guanran Wang"; + home = "/Users/guanranwang"; + shell = pkgs.fish; + uid = 501; + }; + }; + + ### Options + myFlake.darwin.networking.dns = lib.mkDefault "alidns"; + time.timeZone = lib.mkDefault "Asia/Shanghai"; + + ### Flakes + imports = [ + ../../../../../darwin/flake-modules/home-manager.nix + ]; + + ### home-manager + home-manager.users.guanranwang.imports = map (n: ../../../home-manager/${n}) [ + "default.nix" + "profiles/command-line/darwin" + ]; +} diff --git a/users/guanranwang/nixos/presets/desktop/gaming.nix b/users/guanranwang/darwin/profiles/desktop/addtional/misc/gaming.nix similarity index 52% rename from users/guanranwang/nixos/presets/desktop/gaming.nix rename to users/guanranwang/darwin/profiles/desktop/addtional/misc/gaming.nix index 375e5d8..94bc614 100644 --- a/users/guanranwang/nixos/presets/desktop/gaming.nix +++ b/users/guanranwang/darwin/profiles/desktop/addtional/misc/gaming.nix @@ -1,5 +1,5 @@ {...}: { home-manager.users.guanranwang.imports = [ - ../../../home-manager/profiles/gaming/nixos + ../../../../../home-manager/profiles/gaming/darwin ]; } diff --git a/users/guanranwang/darwin/profiles/desktop/default.nix b/users/guanranwang/darwin/profiles/desktop/default.nix new file mode 100644 index 0000000..e3ffcbd --- /dev/null +++ b/users/guanranwang/darwin/profiles/desktop/default.nix @@ -0,0 +1,17 @@ +{...}: { + imports = [ + ../core + ]; + + ### home-manager + home-manager.users.guanranwang.imports = map (n: ../../../home-manager/${n}) [ + "modules/terms/alacritty.nix" + "modules/shell/fish.nix" + "modules/shell/bash.nix" + "modules/editor/helix.nix" + "modules/editor/neovim.nix" + "modules/editor/vscode.nix" + + "profiles/graphical-stuff/darwin" + ]; +} diff --git a/users/guanranwang/home-manager/profiles/graphical-stuff/darwin/home.nix b/users/guanranwang/home-manager/profiles/graphical-stuff/darwin/default.nix similarity index 100% rename from users/guanranwang/home-manager/profiles/graphical-stuff/darwin/home.nix rename to users/guanranwang/home-manager/profiles/graphical-stuff/darwin/default.nix diff --git a/users/guanranwang/home-manager/profiles/graphical-stuff/nixos/fonts.nix b/users/guanranwang/home-manager/profiles/graphical-stuff/nixos/fonts.nix index 2be6638..90f6df1 100644 --- a/users/guanranwang/home-manager/profiles/graphical-stuff/nixos/fonts.nix +++ b/users/guanranwang/home-manager/profiles/graphical-stuff/nixos/fonts.nix @@ -6,17 +6,11 @@ }; home.packages = with pkgs; [ - ### Sans + ### Inter inter - ### Monospace - jetbrains-mono - (nerdfonts.override { - fonts = [ - "JetBrainsMono" - "NerdFontsSymbolsOnly" - ]; - }) + ### JetBrains Mono Nerd Font + (nerdfonts.override {fonts = ["JetBrainsMono"];}) ### Adobe Source Han source-han-sans diff --git a/users/guanranwang/nixos/presets/core/clash-meta-client.nix b/users/guanranwang/nixos/profiles/core/addtional/clash-meta-client.nix similarity index 97% rename from users/guanranwang/nixos/presets/core/clash-meta-client.nix rename to users/guanranwang/nixos/profiles/core/addtional/clash-meta-client.nix index 14e4842..1e36eca 100644 --- a/users/guanranwang/nixos/presets/core/clash-meta-client.nix +++ b/users/guanranwang/nixos/profiles/core/addtional/clash-meta-client.nix @@ -7,7 +7,7 @@ etcDirectory = "clash-meta"; in { imports = [ - ../../../../../flakes/nixos/sops-nix.nix + ../../../../../../nixos/flake-modules/sops-nix.nix ]; ### sops-nix diff --git a/users/guanranwang/nixos/presets/core/hysteria2-server.nix b/users/guanranwang/nixos/profiles/core/addtional/hysteria2-server.nix similarity index 96% rename from users/guanranwang/nixos/presets/core/hysteria2-server.nix rename to users/guanranwang/nixos/profiles/core/addtional/hysteria2-server.nix index 16f4fd3..cffce0b 100644 --- a/users/guanranwang/nixos/presets/core/hysteria2-server.nix +++ b/users/guanranwang/nixos/profiles/core/addtional/hysteria2-server.nix @@ -7,7 +7,7 @@ port = 43956; in { imports = [ - ../../../../../flakes/nixos/sops-nix.nix + ../../../../../../nixos/flake-modules/sops-nix.nix ]; ### Firewall diff --git a/users/guanranwang/nixos/presets/core/juicity-server.nix b/users/guanranwang/nixos/profiles/core/addtional/juicity-server.nix similarity index 96% rename from users/guanranwang/nixos/presets/core/juicity-server.nix rename to users/guanranwang/nixos/profiles/core/addtional/juicity-server.nix index f4cb4d0..6630f2e 100644 --- a/users/guanranwang/nixos/presets/core/juicity-server.nix +++ b/users/guanranwang/nixos/profiles/core/addtional/juicity-server.nix @@ -7,7 +7,7 @@ port = "33829"; in { imports = [ - ../../../../../flakes/nixos/sops-nix.nix + ../../../../../../nixos/flake-modules/sops-nix.nix ]; ### Firewall diff --git a/users/guanranwang/nixos/presets/core.nix b/users/guanranwang/nixos/profiles/core/default.nix similarity index 71% rename from users/guanranwang/nixos/presets/core.nix rename to users/guanranwang/nixos/profiles/core/default.nix index 72670ca..bf049d9 100644 --- a/users/guanranwang/nixos/presets/core.nix +++ b/users/guanranwang/nixos/profiles/core/default.nix @@ -1,6 +1,7 @@ { pkgs, config, + lib, ... }: { users.users."guanranwang" = { @@ -19,20 +20,24 @@ packages = []; }; - # for default shell + ### for default shell programs.fish.enable = true; + ### Options + myFlake.nixos.networking.dns = lib.mkDefault "alidns"; + time.timeZone = lib.mkDefault "Asia/Shanghai"; + + ### Flakes imports = [ - ### Flakes - ../../../../flakes/nixos/sops-nix.nix - ../../../../flakes/nixos/hosts.nix + ../../../../../nixos/flake-modules/sops-nix.nix + ../../../../../nixos/flake-modules/hosts.nix ]; ### sops-nix nix.extraOptions = "!include ${config.sops.secrets.nix-access-tokens.path}"; users.groups."nix-access-tokens" = {}; sops = { - defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFile = ../../../secrets/secrets.yaml; age.sshKeyPaths = ["/nix/persist/system/etc/ssh/ssh_host_ed25519_key"]; gnupg.sshKeyPaths = []; secrets = { @@ -46,8 +51,8 @@ }; ### home-manager - home-manager.users.guanranwang.imports = [ - ../../home-manager - ../../home-manager/profiles/command-line/nixos + home-manager.users.guanranwang.imports = map (n: ../../../home-manager/${n}) [ + "default.nix" + "profiles/command-line/nixos" ]; } diff --git a/users/guanranwang/darwin/presets/desktop/gaming.nix b/users/guanranwang/nixos/profiles/desktop/addtional/gaming.nix similarity index 54% rename from users/guanranwang/darwin/presets/desktop/gaming.nix rename to users/guanranwang/nixos/profiles/desktop/addtional/gaming.nix index ceee5c3..3c21666 100644 --- a/users/guanranwang/darwin/presets/desktop/gaming.nix +++ b/users/guanranwang/nixos/profiles/desktop/addtional/gaming.nix @@ -1,5 +1,5 @@ {...}: { home-manager.users.guanranwang.imports = [ - ../../../profiles/gaming/darwin + ../../../../home-manager/profiles/gaming/nixos ]; } diff --git a/users/guanranwang/nixos/presets/desktop/torrenting.nix b/users/guanranwang/nixos/profiles/desktop/addtional/torrenting.nix similarity index 52% rename from users/guanranwang/nixos/presets/desktop/torrenting.nix rename to users/guanranwang/nixos/profiles/desktop/addtional/torrenting.nix index e817bc7..3a9cf68 100644 --- a/users/guanranwang/nixos/presets/desktop/torrenting.nix +++ b/users/guanranwang/nixos/profiles/desktop/addtional/torrenting.nix @@ -1,5 +1,5 @@ {...}: { home-manager.users.guanranwang.imports = [ - ../../../home-manager/profiles/torrenting/nixos + ../../../../home-manager/profiles/torrenting/nixos ]; } diff --git a/users/guanranwang/nixos/presets/desktop.nix b/users/guanranwang/nixos/profiles/desktop/default.nix similarity index 55% rename from users/guanranwang/nixos/presets/desktop.nix rename to users/guanranwang/nixos/profiles/desktop/default.nix index 21c74c8..245bb54 100644 --- a/users/guanranwang/nixos/presets/desktop.nix +++ b/users/guanranwang/nixos/profiles/desktop/default.nix @@ -1,28 +1,35 @@ -{pkgs, ...}: { +{ + pkgs, + lib, + ... +}: { imports = [ - ./core.nix + ../core ### Flakes - ../../../../flakes/nixos/home-manager.nix - ../../../../flakes/nixos/berberman.nix + ../../../../../nixos/flake-modules/home-manager.nix + ../../../../../nixos/flake-modules/berberman.nix ]; + ### Options + myFlake.nixos.boot.noLoaderMenu = lib.mkDefault true; + ### home-manager - home-manager.users.guanranwang.imports = [ - ../../home-manager/profiles/command-line/nixos/fancy-stuff.nix - ../../home-manager/profiles/graphical-stuff/nixos - ../../home-manager/profiles/media/nixos - ../../home-manager/modules/terms/alacritty.nix - ../../home-manager/modules/shell/fish.nix - ../../home-manager/modules/shell/bash.nix - ../../home-manager/modules/editor/helix.nix - ../../home-manager/modules/editor/neovim.nix - ../../home-manager/modules/editor/vscode.nix - ../../home-manager/modules/browser/chromium.nix - ../../home-manager/modules/browser/librewolf.nix - ../../home-manager/modules/lang/nix.nix - ../../home-manager/modules/lang/go.nix - ../../home-manager/modules/wm/sway.nix + home-manager.users.guanranwang.imports = map (n: ../../../home-manager/${n}) [ + "profiles/command-line/nixos/fancy-stuff.nix" + "profiles/graphical-stuff/nixos" + "profiles/media/nixos" + "modules/terms/alacritty.nix" + "modules/shell/fish.nix" + "modules/shell/bash.nix" + "modules/editor/helix.nix" + "modules/editor/neovim.nix" + "modules/editor/vscode.nix" + "modules/browser/chromium.nix" + "modules/browser/librewolf.nix" + "modules/lang/nix.nix" + "modules/lang/go.nix" + "modules/wm/sway.nix" ]; fonts.enableDefaultPackages = false;