diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5c3c6b..a16f201 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,11 +12,10 @@ jobs: matrix: pkg: - anup - - customscripts - - mpd_discord_richpresence + - discord + - proxychains - st - dmenu - - kbd steps: - uses: actions/checkout@v2.3.4 - uses: cachix/install-nix-action@v13 diff --git a/colemak-dh.xkm b/colemak-dh.xkm deleted file mode 100644 index d08701a..0000000 Binary files a/colemak-dh.xkm and /dev/null differ diff --git a/flake.nix b/flake.nix index da8af40..4cf4497 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,22 @@ }; }) // ( + let + personalModules = [ + ./modules/nvidia-offload.nix + ./modules/pipewire.nix + ./modules/xorg.nix + ]; + commonModules = [ + ./modules/nvim + ./modules/vault-agent.nix + ]; + serverModules = [ + ./modules/builder.nix + ./modules/min-pkgs.nix + ./modules/min-stuff.nix + ]; + in { hm-configs = { natto = inputs.home-manager.lib.homeManagerConfiguration { @@ -61,48 +77,44 @@ #Home laptop Satori = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ - ./hosts/personal/satori.nix + modules = [ + ./hosts/satori inputs.agenix.nixosModules.age inputs.home-manager.nixosModules.home-manager { nixpkgs.pkgs = self.legacyPackages.x86_64-linux; } - ]; + ] + ++ personalModules + ++ commonModules; }; + #Home server (RPi4) Marisa = nixpkgs.lib.nixosSystem { system = "aarch64-linux"; - modules = [ - ./modules/vault-agent.nix - ./hosts/servers/marisa.nix + modules = [ + ./hosts/marisa #inputs.mailserver.nixosModules.mailserver { nixpkgs.pkgs = self.legacyPackages.aarch64-linux; } - ]; - }; - #idk, maybe to try cross compiling Marisa on home laptop later? - Marisus = nixpkgs.lib.nixosSystem { - system = "aarch64-linux"; - modules = [ - ./hosts/servers/marisa.nix - { - nixpkgs.pkgs = (self.legacyPackages.x86_64-linux) // {crossSystem.config = "aarch64-unknown-linux-gnu";}; - } - ]; + ] + ++ commonModules + ++ serverModules; }; + #Oracle Cloud VM Remilia = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ - ./modules/vault-agent.nix - ./hosts/servers/remilia.nix + modules = [ + ./hosts/remilia inputs.mailserver.nixosModules.mailserver { nixpkgs.pkgs = self.legacyPackages.x86_64-linux; } - ]; + ] + ++ commonModules + ++ serverModules; }; }; }); diff --git a/hm-switch b/hm-switch index bd895a6..1c1ef02 100755 --- a/hm-switch +++ b/hm-switch @@ -3,7 +3,7 @@ echo "You're about to switch your home-manager configuration as '$USER'" read -p "Continue (y/n)?" conf -if [ ${conf,,} == "n" ]; then +if [ ${conf,,} != "y" ]; then echo "If this is not you, then log into your profile first!" exit 1 else diff --git a/hosts/README.md b/hosts/README.md new file mode 100644 index 0000000..a909ca3 --- /dev/null +++ b/hosts/README.md @@ -0,0 +1,3 @@ +Satori is my home laptop\ +Marisa is my Raspberry Pi 4 (B)\ +Remilia is my cloud VM diff --git a/hosts/servers/marisa/boot.nix b/hosts/marisa/boot.nix similarity index 100% rename from hosts/servers/marisa/boot.nix rename to hosts/marisa/boot.nix diff --git a/hosts/marisa/default.nix b/hosts/marisa/default.nix new file mode 100755 index 0000000..a02b114 --- /dev/null +++ b/hosts/marisa/default.nix @@ -0,0 +1,12 @@ +{config, pkgs, ...}: +{ + imports = + [ + ./networking.nix + ./hardware.nix + ./boot.nix + ./services.nix + ]; + programs.gnupg.agent.enable = pkgs.lib.mkForce false; + system.stateVersion = "21.05"; +} diff --git a/hosts/servers/marisa/hardware.nix b/hosts/marisa/hardware.nix similarity index 100% rename from hosts/servers/marisa/hardware.nix rename to hosts/marisa/hardware.nix diff --git a/hosts/servers/marisa/networking.nix b/hosts/marisa/networking.nix similarity index 100% rename from hosts/servers/marisa/networking.nix rename to hosts/marisa/networking.nix diff --git a/hosts/servers/marisa/services.nix b/hosts/marisa/services.nix similarity index 95% rename from hosts/servers/marisa/services.nix rename to hosts/marisa/services.nix index 1a72faa..6822bd5 100755 --- a/hosts/servers/marisa/services.nix +++ b/hosts/marisa/services.nix @@ -6,8 +6,7 @@ permitRootLogin = "yes"; }; vault = { - package = pkgs.vault-bin; - enable = true; + package = pkgs.vault-bin; enable = true; tlsCertFile = "/var/certs/cert.pem"; tlsKeyFile = "/var/certs/key.pem"; address = "0.0.0.0:8800"; @@ -97,5 +96,5 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPX1HDzWpoaOcU8GDEGuDzXgxkCpyeqxRR6gLs/8JgHw" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK06ZUa9BKmZ6m+xapBjOAm10OCLzxIm8ais20wQC47m" ]; - security.pki.certificateFiles = [ ../../../cert.pem ]; + security.pki.certificateFiles = [ ../../cert.pem ]; } diff --git a/hosts/personal/README.md b/hosts/personal/README.md deleted file mode 100644 index 7599078..0000000 --- a/hosts/personal/README.md +++ /dev/null @@ -1 +0,0 @@ -Satori is my home laptop diff --git a/hosts/personal/satori.nix b/hosts/personal/satori.nix deleted file mode 100644 index 95965ce..0000000 --- a/hosts/personal/satori.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ lib, config, ...}: -{ - imports = - [ - ./satori/hardware.nix - ./satori/stuff.nix - ./satori/pkgs.nix - ./satori/networking.nix - ./satori/boot.nix - ./satori/services.nix - ./common/nvidia-offload.nix - ./common/pipewire.nix - ./common/xorg.nix - ../../configs/nvim.nix - ]; - system.stateVersion = "21.05"; -} diff --git a/hosts/servers/remilia/boot.nix b/hosts/remilia/boot.nix similarity index 100% rename from hosts/servers/remilia/boot.nix rename to hosts/remilia/boot.nix diff --git a/hosts/remilia/default.nix b/hosts/remilia/default.nix new file mode 100755 index 0000000..81e3af3 --- /dev/null +++ b/hosts/remilia/default.nix @@ -0,0 +1,12 @@ +{lib, config, ...}: +{ + imports = + [ + ./networking.nix + ./hardware.nix + ./boot.nix + ./services.nix + ./mailserver.nix + ]; + system.stateVersion = "21.11"; +} diff --git a/hosts/servers/remilia/hardware.nix b/hosts/remilia/hardware.nix similarity index 100% rename from hosts/servers/remilia/hardware.nix rename to hosts/remilia/hardware.nix diff --git a/hosts/servers/remilia/mailserver.nix b/hosts/remilia/mailserver.nix similarity index 100% rename from hosts/servers/remilia/mailserver.nix rename to hosts/remilia/mailserver.nix diff --git a/hosts/servers/remilia/networking.nix b/hosts/remilia/networking.nix similarity index 100% rename from hosts/servers/remilia/networking.nix rename to hosts/remilia/networking.nix diff --git a/hosts/servers/remilia/services.nix b/hosts/remilia/services.nix similarity index 97% rename from hosts/servers/remilia/services.nix rename to hosts/remilia/services.nix index a0e813b..2beea3e 100755 --- a/hosts/servers/remilia/services.nix +++ b/hosts/remilia/services.nix @@ -75,5 +75,5 @@ "git.weirdnatto.in".email = "git+acme@weirdnatto.in"; }; }; - security.pki.certificateFiles = [ ../../../cert.pem ]; + security.pki.certificateFiles = [ ../../cert.pem ]; } diff --git a/hosts/personal/satori/boot.nix b/hosts/satori/boot.nix similarity index 100% rename from hosts/personal/satori/boot.nix rename to hosts/satori/boot.nix diff --git a/hosts/personal/satori/cirno.png b/hosts/satori/cirno.png similarity index 100% rename from hosts/personal/satori/cirno.png rename to hosts/satori/cirno.png diff --git a/hosts/satori/default.nix b/hosts/satori/default.nix new file mode 100644 index 0000000..3fb351e --- /dev/null +++ b/hosts/satori/default.nix @@ -0,0 +1,13 @@ +{ lib, config, ...}: +{ + imports = + [ + ./hardware.nix + ./stuff.nix + ./pkgs.nix + ./networking.nix + ./boot.nix + ./services.nix + ]; + system.stateVersion = "21.05"; +} diff --git a/hosts/personal/satori/hardware.nix b/hosts/satori/hardware.nix similarity index 100% rename from hosts/personal/satori/hardware.nix rename to hosts/satori/hardware.nix diff --git a/hosts/personal/satori/networking.nix b/hosts/satori/networking.nix similarity index 100% rename from hosts/personal/satori/networking.nix rename to hosts/satori/networking.nix diff --git a/hosts/personal/satori/pkgs.nix b/hosts/satori/pkgs.nix similarity index 100% rename from hosts/personal/satori/pkgs.nix rename to hosts/satori/pkgs.nix diff --git a/hosts/personal/satori/services.nix b/hosts/satori/services.nix similarity index 95% rename from hosts/personal/satori/services.nix rename to hosts/satori/services.nix index a9a6f6c..4aeefd9 100644 --- a/hosts/personal/satori/services.nix +++ b/hosts/satori/services.nix @@ -31,7 +31,7 @@ #printing.wantedBy = lib.mkForce []; #vault.wantedBy = lib.mkForce []; }; - security.pki.certificateFiles = [ ../../../cert.pem ]; + security.pki.certificateFiles = [ ../../cert.pem ]; /* virtualisation.libvirtd = { enable = true; onBoot = "ignore"; diff --git a/hosts/personal/satori/stuff.nix b/hosts/satori/stuff.nix similarity index 100% rename from hosts/personal/satori/stuff.nix rename to hosts/satori/stuff.nix diff --git a/hosts/servers/marisa.nix b/hosts/servers/marisa.nix deleted file mode 100755 index f184bd9..0000000 --- a/hosts/servers/marisa.nix +++ /dev/null @@ -1,16 +0,0 @@ -{config, pkgs, ...}: -{ - imports = - [ - ./pkgs.nix - ./stuff.nix - ./marisa/networking.nix - ./marisa/hardware.nix - ./marisa/boot.nix - ./marisa/services.nix - ./marisa/builder.nix - ../../configs/nvim.nix - ]; - programs.gnupg.agent.enable = pkgs.lib.mkForce false; - system.stateVersion = "21.05"; -} diff --git a/hosts/servers/marisa/cachix.nix b/hosts/servers/marisa/cachix.nix deleted file mode 100644 index cce90a3..0000000 --- a/hosts/servers/marisa/cachix.nix +++ /dev/null @@ -1,14 +0,0 @@ - -# WARN: this file will get overwritten by $ cachix use -{ pkgs, lib, ... }: - -let - folder = ./cachix; - toImport = name: value: folder + ("/" + name); - filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; - imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); -in { - inherit imports; - nix.binaryCaches = ["https://cache.nixos.org/"]; -} - \ No newline at end of file diff --git a/hosts/servers/marisa/cachix/rpi4.nix b/hosts/servers/marisa/cachix/rpi4.nix deleted file mode 100644 index f678710..0000000 --- a/hosts/servers/marisa/cachix/rpi4.nix +++ /dev/null @@ -1,12 +0,0 @@ - -{ - nix = { - binaryCaches = [ - "https://rpi4.cachix.org" - ]; - binaryCachePublicKeys = [ - "rpi4.cachix.org-1:fMaYBuIlj/Sa9YTXnXMXoXnVZEoVhnFxOkxseKKlku8=" - ]; - }; -} - \ No newline at end of file diff --git a/hosts/servers/remilia.nix b/hosts/servers/remilia.nix deleted file mode 100755 index 9f94606..0000000 --- a/hosts/servers/remilia.nix +++ /dev/null @@ -1,17 +0,0 @@ -{lib, config, ...}: -{ - imports = - [ - ./pkgs.nix - ./stuff.nix - ./remilia/networking.nix - ./remilia/hardware.nix - ./remilia/boot.nix - ./remilia/services.nix - ./remilia/builder.nix - ./remilia/mailserver.nix - ../../configs/nvim.nix - ]; - # programs.gnupg.agent.enable = lib.mkForce false; - system.stateVersion = "21.11"; -} diff --git a/hosts/servers/remilia/builder.nix b/hosts/servers/remilia/builder.nix deleted file mode 100644 index 4ded076..0000000 --- a/hosts/servers/remilia/builder.nix +++ /dev/null @@ -1,14 +0,0 @@ -{config, ...}: -{ - nix.buildMachines = [ { - hostName = "Satori"; - system = "x86_64-linux"; - maxJobs = 4; - speedFactor = 2; - supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; - }] ; - nix.distributedBuilds = true; - nix.extraOptions = '' - builders-use-substitutes = true - ''; -} diff --git a/hosts/servers/marisa/builder.nix b/modules/builder.nix similarity index 85% rename from hosts/servers/marisa/builder.nix rename to modules/builder.nix index db0c60b..72479d9 100644 --- a/hosts/servers/marisa/builder.nix +++ b/modules/builder.nix @@ -2,7 +2,7 @@ { nix.buildMachines = [ { hostName = "Satori"; - system = "aarch64-linux"; + systems = ["x86_64-linux" "aarch64-linux"]; maxJobs = 4; speedFactor = 2; supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; diff --git a/hosts/personal/common/colemak-dh b/modules/colemak-dh similarity index 100% rename from hosts/personal/common/colemak-dh rename to modules/colemak-dh diff --git a/hosts/servers/pkgs.nix b/modules/min-pkgs.nix similarity index 91% rename from hosts/servers/pkgs.nix rename to modules/min-pkgs.nix index 0a2dcec..af7aada 100755 --- a/hosts/servers/pkgs.nix +++ b/modules/min-pkgs.nix @@ -6,7 +6,9 @@ vim wireguard vault + tree-sitter ]; + programs = { zsh = { enable = true; @@ -24,13 +26,12 @@ }; }; }; + nix = { package = pkgs.nixUnstable; extraOptions = '' experimental-features = nix-command ca-references flakes - builders-use-substitutes = true ''; trustedUsers = [ "root" ]; }; - documentation.enable = false; } diff --git a/hosts/servers/stuff.nix b/modules/min-stuff.nix similarity index 100% rename from hosts/servers/stuff.nix rename to modules/min-stuff.nix diff --git a/hosts/personal/common/nvidia-offload.nix b/modules/nvidia-offload.nix similarity index 100% rename from hosts/personal/common/nvidia-offload.nix rename to modules/nvidia-offload.nix diff --git a/configs/nvim.nix b/modules/nvim/default.nix similarity index 86% rename from configs/nvim.nix rename to modules/nvim/default.nix index bbb2d42..2fcda6f 100644 --- a/configs/nvim.nix +++ b/modules/nvim/default.nix @@ -10,7 +10,7 @@ configure = { customRC = '' lua << EOF - ${builtins.readFile ./nvim/init.lua} + ${builtins.readFile ./init.lua} EOF ''; packages.myVimPackage = with pkgs.unstable.vimPlugins; { @@ -30,7 +30,7 @@ vim-vsnip nvim-treesitter vim-nix - (gruvbox.overrideAttrs (oa: { patches = [ ./nvim/gruvbox.patch ]; })) + (gruvbox.overrideAttrs (oa: { patches = [ ./gruvbox.patch ]; })) ]; }; }; diff --git a/configs/nvim/gruvbox.patch b/modules/nvim/gruvbox.patch similarity index 100% rename from configs/nvim/gruvbox.patch rename to modules/nvim/gruvbox.patch diff --git a/configs/nvim/init.lua b/modules/nvim/init.lua similarity index 100% rename from configs/nvim/init.lua rename to modules/nvim/init.lua diff --git a/hosts/personal/common/pipewire.nix b/modules/pipewire.nix similarity index 100% rename from hosts/personal/common/pipewire.nix rename to modules/pipewire.nix diff --git a/hosts/personal/common/xorg.nix b/modules/xorg.nix similarity index 100% rename from hosts/personal/common/xorg.nix rename to modules/xorg.nix