diff --git a/.sops.yaml b/.sops.yaml index 6f2ac3b..bc2cfd3 100644 --- a/.sops.yaml +++ b/.sops.yaml @@ -60,7 +60,7 @@ creation_rules: key_groups: - age: - *system_rainbow_planet - - path_regex: modules/hosts/common/secrets.yaml$ + - path_regex: modules/shared/secrets.yaml$ key_groups: - age: - *system_bigboy diff --git a/2024-12-rework/.gitignore b/2024-12-rework/.gitignore deleted file mode 100644 index e370078..0000000 --- a/2024-12-rework/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -result/ -result diff --git a/2024-12-rework/configuration.nix b/2024-12-rework/configuration.nix deleted file mode 100644 index 5d52004..0000000 --- a/2024-12-rework/configuration.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ inputs, pkgs, ... }: { - imports = [ - ./hardware-configuration.nix - ]; - - system.stateVersion = "23.05"; - - boot = { - initrd.systemd = { - enable = true; - network.wait-online.enable = false; # Handled by NetworkManager - }; - loader = { - efi.canTouchEfiVariables = true; - systemd-boot= { - enable = true; - consoleMode = "1"; - }; - }; - }; - - environment.systemPackages = with pkgs; [ - olm - ]; -} \ No newline at end of file diff --git a/2024-12-rework/flake.lock b/2024-12-rework/flake.lock deleted file mode 100644 index 49ad4fd..0000000 --- a/2024-12-rework/flake.lock +++ /dev/null @@ -1,183 +0,0 @@ -{ - "nodes": { - "config": { - "locked": { - "dir": "templates/config", - "lastModified": 1719931926, - "narHash": "sha256-B8j9lHX0LqWlZkm8JxZRN6919RQjJEu/1J1SR8pU/ww=", - "owner": "stackbuilders", - "repo": "nixpkgs-terraform", - "rev": "034287ee462c87dadc14a94d4b53a48ed66c7b3d", - "type": "github" - }, - "original": { - "dir": "templates/config", - "owner": "stackbuilders", - "repo": "nixpkgs-terraform", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1722555600, - "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733050161, - "narHash": "sha256-lYnT+EYE47f5yY3KS/Kd4pJ6CO9fhCqumkYYkQ3TK20=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "62d536255879be574ebfe9b87c4ac194febf47c5", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-24.11", - "repo": "home-manager", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1733120037, - "narHash": "sha256-En+gSoVJ3iQKPDU1FHrR6zIxSLXKjzKY+pnh9tt+Yts=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "f9f0d5c5380be0a599b1fb54641fa99af8281539", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-1_0": { - "locked": { - "lastModified": 1699291058, - "narHash": "sha256-5ggduoaAMPHUy4riL+OrlAZE14Kh7JWX4oLEs22ZqfU=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "41de143fda10e33be0f47eab2bfe08a50f234267", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "rev": "41de143fda10e33be0f47eab2bfe08a50f234267", - "type": "github" - } - }, - "nixpkgs-1_6": { - "locked": { - "lastModified": 1712757991, - "narHash": "sha256-kR7C7Fqt3JP40h0mzmSZeWI5pk1iwqj4CSeGjnUbVHc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "d6b3ddd253c578a7ab98f8011e59990f21dc3932", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "rev": "d6b3ddd253c578a7ab98f8011e59990f21dc3932", - "type": "github" - } - }, - "nixpkgs-1_9": { - "locked": { - "lastModified": 1732617236, - "narHash": "sha256-PYkz6U0bSEaEB1al7O1XsqVNeSNS+s3NVclJw7YC43w=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1722555339, - "narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" - } - }, - "nixpkgs-terraform": { - "inputs": { - "config": "config", - "flake-parts": "flake-parts", - "nixpkgs-1_0": "nixpkgs-1_0", - "nixpkgs-1_6": "nixpkgs-1_6", - "nixpkgs-1_9": "nixpkgs-1_9", - "systems": "systems" - }, - "locked": { - "lastModified": 1732844581, - "narHash": "sha256-BwHD1d6Bl5LL/HciTf+mQmBN3I3S6nYqcB+5BXVozNk=", - "owner": "stackbuilders", - "repo": "nixpkgs-terraform", - "rev": "b4db1b59d8f62cd37b6f9540e368d0e2627c4a2d", - "type": "github" - }, - "original": { - "owner": "stackbuilders", - "repo": "nixpkgs-terraform", - "type": "github" - } - }, - "root": { - "inputs": { - "home-manager": "home-manager", - "nixpkgs": "nixpkgs", - "nixpkgs-terraform": "nixpkgs-terraform" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/2024-12-rework/flake.nix b/2024-12-rework/flake.nix deleted file mode 100644 index 394abbb..0000000 --- a/2024-12-rework/flake.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; - - home-manager = { - url = "github:nix-community/home-manager/release-24.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - nixpkgs-terraform = { - url = "github:stackbuilders/nixpkgs-terraform"; - # inputs.nixpkgs-1_6.follows = "nixpkgs"; - # inputs.nixpkgs-1_9.follows = "nixpkgs-unstable"; - }; - }; - - outputs = inputs: { - nixosConfigurations = { - rainbow-planet = inputs.nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - system = "x86_64-linux"; - modules = [ - ./configuration.nix - ./nixpkgs-settings.nix - inputs.home-manager.nixosModules.home-manager - ]; - }; - }; - }; -} diff --git a/2024-12-rework/hardware-configuration.nix b/2024-12-rework/hardware-configuration.nix deleted file mode 100644 index d3c51fe..0000000 --- a/2024-12-rework/hardware-configuration.nix +++ /dev/null @@ -1,44 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.kernelParams = [ - "i915.enable_fbc=1" - "i915.enable_psr=2" - ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/eb9a2c7e-ae61-4d06-9464-49b98d576f7c"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/924D-E7A4"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/166d24ca-401c-492e-845d-bb1d0d6d7d86"; } - ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/2024-12-rework/nixpkgs-settings.nix b/2024-12-rework/nixpkgs-settings.nix deleted file mode 100644 index ec86e08..0000000 --- a/2024-12-rework/nixpkgs-settings.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ inputs, ... }: { - nixpkgs = { - config = { - allowUnfree = true; - permittedInsecurePackages = [ "olm-3.2.16" "electron-27.3.11" ]; - }; - overlays = [ inputs.nixpkgs-terraform.overlays.default ]; - }; -} \ No newline at end of file diff --git a/examples/flake-structure.nix b/examples/flake-structure.nix index b47d1a5..5575f26 100644 --- a/examples/flake-structure.nix +++ b/examples/flake-structure.nix @@ -1,49 +1,46 @@ { - inputs = {}; - outputs = inputs@{}: let - darwinHostConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: - nix-darwin.lib.darwinSystem { }; - - mkNixosHost = { system, hostname, username, additionalModules, additionalSpecialArgs }: - nixpkgs.lib.nixosSystem { }; - - linuxHomeConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: - home-manager.lib.homeManagerConfiguration { }; - - in { - # Darwin (macOS) hosts - darwinConfigurations = { - mightymac = darwinHostConfig { - system = "aarch64-darwin"; - hostname = "mightymac"; - username = "gene.liverman"; - additionalModules = []; - additionalSpecialArgs = {}; - }; - }; - - # NixOS hosts - nixosConfigurations = { - rainbow-planet = mkNixosHost { - system = "x86_64-linux"; - hostname = "rainbow-planet"; - username = "gene"; - additionalModules = [ - nixos-hardware.nixosModules.dell-xps-13-9360 - ]; - additionalSpecialArgs = {}; - }; - }; - - # Home Manager (only) users - homeConfigurations = { - gene = linuxHomeConfig { - system = "x86_64-linux"; - hostname = "mini-watcher"; - username = "gene"; - additionalModules = []; - additionalSpecialArgs = {}; - }; - }; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; + home-manager.url = "github:nix-community/home-manager"; + nix-darwin.url = "github:lnl7/nix-darwin"; + nixos-hardware.url = "github:NixOS/nixos-hardware"; }; -} \ No newline at end of file + + outputs = + inputs@{ self, ... }: + let + # Import helper functions from lib/ + localLib = import ./lib { inherit inputs; }; + in + { + # Darwin (macOS) hosts + darwinConfigurations = { + mightymac = localLib.mkDarwinHost { + system = "aarch64-darwin"; + hostname = "mightymac"; + username = "gene.liverman"; + }; + }; + + # NixOS hosts + nixosConfigurations = { + rainbow-planet = localLib.mkNixosHost { + system = "x86_64-linux"; + hostname = "rainbow-planet"; + username = "gene"; + additionalModules = [ + inputs.nixos-hardware.nixosModules.dell-xps-13-9360 + ]; + }; + }; + + # Home Manager (only) users + homeConfigurations = { + gene = localLib.mkHomeConfig { + system = "x86_64-linux"; + homeDirectory = "/home/gene"; + username = "gene"; + }; + }; + }; +} diff --git a/flake.nix b/flake.nix index c21312c..b5b03e1 100644 --- a/flake.nix +++ b/flake.nix @@ -87,28 +87,6 @@ # Functions that setup systems localLib = import ./lib { inherit inputs; }; - linuxHomeConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: inputs.home-manager.lib.homeManagerConfiguration { - extraSpecialArgs = { inherit inputs hostname username; - pkgs = import inputs.nixpkgs { - inherit system; - config = { - allowUnfree = true; - permittedInsecurePackages = [ "olm-3.2.16" "electron-21.4.4" ]; - }; - }; - } // additionalSpecialArgs; - modules = [ - ./modules/home-manager/hosts/${hostname}/${username}.nix - { - home = { - username = "${username}"; - homeDirectory = "/home/${username}"; - }; - } - inputs.sops-nix.homeManagerModules.sops - ] ++ additionalModules; - }; # end homeManagerConfiguration - in { # Darwin (macOS) hosts darwinConfigurations = { diff --git a/lib/mkDarwinHost.nix b/lib/mkDarwinHost.nix index bdcd92a..0d53859 100644 --- a/lib/mkDarwinHost.nix +++ b/lib/mkDarwinHost.nix @@ -26,8 +26,8 @@ useUserPackages = true; users.${username}.imports = [ inputs.sops-nix.homeManagerModule # user-level secrets management - ../modules/hosts/common - ../modules/hosts/common/all-gui.nix + ../modules/shared/home/general + ../modules/shared/home/general/all-gui.nix ../modules/hosts/darwin/home.nix ../modules/hosts/darwin/${hostname}/home-${username}.nix ]; diff --git a/lib/mkHomeConfig.nix b/lib/mkHomeConfig.nix index f4ef0cf..d09cc99 100644 --- a/lib/mkHomeConfig.nix +++ b/lib/mkHomeConfig.nix @@ -12,7 +12,7 @@ # the path to your home.nix. modules = [ ./nixpkgs-settings.nix - ../modules/hosts/common + ../modules/shared/home/general ../modules/hosts/home-manager-only ../modules/hosts/home-manager-only/home-${username}.nix diff --git a/lib/mkNixosHost.nix b/lib/mkNixosHost.nix index 68b050b..b4023d2 100644 --- a/lib/mkNixosHost.nix +++ b/lib/mkNixosHost.nix @@ -19,8 +19,8 @@ useGlobalPkgs = true; useUserPackages = true; users.${username}.imports = [ - ../modules/hosts/common - ../modules/hosts/common/linux/home.nix + ../modules/shared/home/general + ../modules/shared/home/linux ../modules/hosts/nixos/${hostname}/home-${username}.nix ]; }; diff --git a/modules/hosts/nixos/bigboy/default.nix b/modules/hosts/nixos/bigboy/default.nix index 9556bf2..6a0025d 100644 --- a/modules/hosts/nixos/bigboy/default.nix +++ b/modules/hosts/nixos/bigboy/default.nix @@ -10,8 +10,8 @@ { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ../../common/linux/flatpaks.nix - ../../common/linux/ripping.nix + ../../../shared/nixos/flatpaks.nix + ../../../shared/nixos/ripping.nix ]; system.stateVersion = "24.11"; # Did you read the comment? diff --git a/modules/hosts/nixos/bigboy/home-gene.nix b/modules/hosts/nixos/bigboy/home-gene.nix index 962d99e..9042b47 100644 --- a/modules/hosts/nixos/bigboy/home-gene.nix +++ b/modules/hosts/nixos/bigboy/home-gene.nix @@ -1,9 +1,9 @@ { ... }: { home.stateVersion = "24.05"; imports = [ - ../../common/all-gui.nix - ../../common/linux/apps/tilix.nix - ../../common/linux/apps/xfce4-terminal.nix + ../../../shared/home/general/all-gui.nix + ../../../shared/home/linux/apps/tilix.nix + ../../../shared/home/linux/apps/xfce4-terminal.nix ]; programs = { diff --git a/modules/hosts/nixos/default.nix b/modules/hosts/nixos/default.nix index cef3366..9027d2b 100644 --- a/modules/hosts/nixos/default.nix +++ b/modules/hosts/nixos/default.nix @@ -1,6 +1,6 @@ { hostname, pkgs, username, ... }: { imports = [ - ../common/linux/internationalisation.nix + ../../shared/nixos/internationalisation.nix ]; environment = { diff --git a/modules/hosts/nixos/hetznix01/default.nix b/modules/hosts/nixos/hetznix01/default.nix index 5f06448..63a5019 100644 --- a/modules/hosts/nixos/hetznix01/default.nix +++ b/modules/hosts/nixos/hetznix01/default.nix @@ -1,6 +1,6 @@ { inputs, pkgs, username, ... }: { imports = [ - ../../common/linux/nixroutes.nix + ../../../shared/nixos/nixroutes.nix ./disk-config.nix ./hardware-configuration.nix ./post-install diff --git a/modules/hosts/nixos/hetznix01/post-install/default.nix b/modules/hosts/nixos/hetznix01/post-install/default.nix index 83eddd6..8807f58 100644 --- a/modules/hosts/nixos/hetznix01/post-install/default.nix +++ b/modules/hosts/nixos/hetznix01/post-install/default.nix @@ -3,8 +3,8 @@ restic_backup_time = "01:00"; in { imports = [ - ../../../common/linux/lets-encrypt.nix - ../../../common/linux/restic.nix + ../../../../shared/nixos/lets-encrypt.nix + ../../../../shared/nixos/restic.nix ./containers/emqx.nix ./matrix-synapse.nix ./monitoring.nix diff --git a/modules/hosts/nixos/hetznix01/post-install/monitoring.nix b/modules/hosts/nixos/hetznix01/post-install/monitoring.nix index 20fc60b..97d9c85 100644 --- a/modules/hosts/nixos/hetznix01/post-install/monitoring.nix +++ b/modules/hosts/nixos/hetznix01/post-install/monitoring.nix @@ -120,7 +120,7 @@ in { vmagent_push_pw = { owner = "vmagent"; restartUnits = ["vmagent.service"]; - sopsFile = ../../../common/secrets.yaml; + sopsFile = ../../../../shared/secrets.yaml; }; }; }; diff --git a/modules/hosts/nixos/hetznix02/default.nix b/modules/hosts/nixos/hetznix02/default.nix index 6d33499..d3f18a0 100644 --- a/modules/hosts/nixos/hetznix02/default.nix +++ b/modules/hosts/nixos/hetznix02/default.nix @@ -1,6 +1,6 @@ { inputs, pkgs, username, ... }: { imports = [ - ../../common/linux/nixroutes.nix + ../../../shared/nixos/nixroutes.nix ./disk-config.nix ./hardware-configuration.nix ./post-install diff --git a/modules/hosts/nixos/hetznix02/post-install/default.nix b/modules/hosts/nixos/hetznix02/post-install/default.nix index 2500481..9daed2b 100644 --- a/modules/hosts/nixos/hetznix02/post-install/default.nix +++ b/modules/hosts/nixos/hetznix02/post-install/default.nix @@ -1,6 +1,6 @@ { config, username, ... }: { imports = [ - ../../../common/linux/lets-encrypt.nix + ../../../../shared/nixos/lets-encrypt.nix ./monitoring.nix ./nginx.nix ]; diff --git a/modules/hosts/nixos/hetznix02/post-install/monitoring.nix b/modules/hosts/nixos/hetznix02/post-install/monitoring.nix index 20fc60b..97d9c85 100644 --- a/modules/hosts/nixos/hetznix02/post-install/monitoring.nix +++ b/modules/hosts/nixos/hetznix02/post-install/monitoring.nix @@ -120,7 +120,7 @@ in { vmagent_push_pw = { owner = "vmagent"; restartUnits = ["vmagent.service"]; - sopsFile = ../../../common/secrets.yaml; + sopsFile = ../../../../shared/secrets.yaml; }; }; }; diff --git a/modules/hosts/nixos/kiosk-entryway/default.nix b/modules/hosts/nixos/kiosk-entryway/default.nix index a694dbf..15e13f7 100644 --- a/modules/hosts/nixos/kiosk-entryway/default.nix +++ b/modules/hosts/nixos/kiosk-entryway/default.nix @@ -97,7 +97,7 @@ path = "${config.users.users.${username}.home}/.private-env"; }; wifi_creds = { - sopsFile = ../../common/secrets.yaml; + sopsFile = ../../../shared/secrets.yaml; restartUnits = [ "wpa_supplicant.service" ]; diff --git a/modules/hosts/nixos/kiosk-entryway/monitoring.nix b/modules/hosts/nixos/kiosk-entryway/monitoring.nix index 20fc60b..97d9c85 100644 --- a/modules/hosts/nixos/kiosk-entryway/monitoring.nix +++ b/modules/hosts/nixos/kiosk-entryway/monitoring.nix @@ -120,7 +120,7 @@ in { vmagent_push_pw = { owner = "vmagent"; restartUnits = ["vmagent.service"]; - sopsFile = ../../../common/secrets.yaml; + sopsFile = ../../../../shared/secrets.yaml; }; }; }; diff --git a/modules/hosts/nixos/kiosk-gene-desk/default.nix b/modules/hosts/nixos/kiosk-gene-desk/default.nix index ace2fe5..24e208a 100644 --- a/modules/hosts/nixos/kiosk-gene-desk/default.nix +++ b/modules/hosts/nixos/kiosk-gene-desk/default.nix @@ -90,7 +90,7 @@ path = "${config.users.users.${username}.home}/.private-env"; }; wifi_creds = { - sopsFile = ../../common/secrets.yaml; + sopsFile = ../../../shared/secrets.yaml; restartUnits = [ "wpa_supplicant.service" ]; diff --git a/modules/hosts/nixos/nixnas1/default.nix b/modules/hosts/nixos/nixnas1/default.nix index 708ccba..bf285a6 100644 --- a/modules/hosts/nixos/nixnas1/default.nix +++ b/modules/hosts/nixos/nixnas1/default.nix @@ -2,7 +2,7 @@ imports = [ ./disk-config.nix ./hardware-configuration.nix - ../../../system/common/linux/restic.nix + ../../../shared/nixos/restic.nix ]; system.stateVersion = "24.05"; diff --git a/modules/hosts/nixos/nixnuc/default.nix b/modules/hosts/nixos/nixnuc/default.nix index c3e1fb1..1e3111c 100644 --- a/modules/hosts/nixos/nixnuc/default.nix +++ b/modules/hosts/nixos/nixnuc/default.nix @@ -11,8 +11,8 @@ in { ./containers/mountain-mesh-bot-discord.nix ./containers/psitransfer.nix ./monitoring-stack.nix - ../../common/linux/lets-encrypt.nix - ../../common/linux/restic.nix + ../../../shared/nixos/lets-encrypt.nix + ../../../shared/nixos/restic.nix ]; system.stateVersion = "23.11"; diff --git a/modules/hosts/nixos/nixnuc/monitoring-stack.nix b/modules/hosts/nixos/nixnuc/monitoring-stack.nix index e486512..89e7ae0 100644 --- a/modules/hosts/nixos/nixnuc/monitoring-stack.nix +++ b/modules/hosts/nixos/nixnuc/monitoring-stack.nix @@ -363,7 +363,7 @@ in { uptimekuma_grafana_api_key = { owner = "vmagent"; restartUnits = ["vmagent.service"]; - sopsFile = ../../common/secrets.yaml; + sopsFile = ../../../shared/secrets.yaml; }; }; }; diff --git a/modules/hosts/nixos/rainbow-planet/default.nix b/modules/hosts/nixos/rainbow-planet/default.nix index 1a0ae65..d0c5439 100644 --- a/modules/hosts/nixos/rainbow-planet/default.nix +++ b/modules/hosts/nixos/rainbow-planet/default.nix @@ -1,8 +1,8 @@ { inputs, config, pkgs, username, ... }: { imports = [ ./hardware-configuration.nix - ../../common/linux/flatpaks.nix - ../../common/linux/ripping.nix + ../../../shared/nixos/flatpaks.nix + ../../../shared/nixos/ripping.nix ]; system.stateVersion = "23.05"; diff --git a/modules/hosts/nixos/rainbow-planet/home-gene.nix b/modules/hosts/nixos/rainbow-planet/home-gene.nix index 2c501a5..9abb351 100644 --- a/modules/hosts/nixos/rainbow-planet/home-gene.nix +++ b/modules/hosts/nixos/rainbow-planet/home-gene.nix @@ -1,12 +1,12 @@ { pkgs, ... }: { home.stateVersion = "23.11"; imports = [ - ../../common/all-gui.nix - ../../common/linux/apps/hexchat.nix - ../../common/linux/apps/pidgin.nix - ../../common/linux/apps/tilix.nix - ../../common/linux/apps/waybar.nix - ../../common/linux/apps/xfce4-terminal.nix + ../../../shared/home/general/all-gui.nix + ../../../shared/home/linux/apps/hexchat.nix + ../../../shared/home/linux/apps/pidgin.nix + ../../../shared/home/linux/apps/tilix.nix + ../../../shared/home/linux/apps/waybar.nix + ../../../shared/home/linux/apps/xfce4-terminal.nix ]; home.file = { diff --git a/modules/hosts/common/files/Microsoft.PowerShell_profile.ps1 b/modules/shared/files/Microsoft.PowerShell_profile.ps1 similarity index 100% rename from modules/hosts/common/files/Microsoft.PowerShell_profile.ps1 rename to modules/shared/files/Microsoft.PowerShell_profile.ps1 diff --git a/modules/hosts/common/files/nvim/lua/config/vim-options.lua b/modules/shared/files/nvim/lua/config/vim-options.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/config/vim-options.lua rename to modules/shared/files/nvim/lua/config/vim-options.lua diff --git a/modules/hosts/common/files/nvim/lua/disabled/barbar.lua b/modules/shared/files/nvim/lua/disabled/barbar.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/disabled/barbar.lua rename to modules/shared/files/nvim/lua/disabled/barbar.lua diff --git a/modules/hosts/common/files/nvim/lua/disabled/cheatsheet.lua b/modules/shared/files/nvim/lua/disabled/cheatsheet.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/disabled/cheatsheet.lua rename to modules/shared/files/nvim/lua/disabled/cheatsheet.lua diff --git a/modules/hosts/common/files/nvim/lua/disabled/nvim-tree.lua b/modules/shared/files/nvim/lua/disabled/nvim-tree.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/disabled/nvim-tree.lua rename to modules/shared/files/nvim/lua/disabled/nvim-tree.lua diff --git a/modules/hosts/common/files/nvim/lua/disabled/themes/dracula.lua b/modules/shared/files/nvim/lua/disabled/themes/dracula.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/disabled/themes/dracula.lua rename to modules/shared/files/nvim/lua/disabled/themes/dracula.lua diff --git a/modules/hosts/common/files/nvim/lua/disabled/themes/gruvbox.lua b/modules/shared/files/nvim/lua/disabled/themes/gruvbox.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/disabled/themes/gruvbox.lua rename to modules/shared/files/nvim/lua/disabled/themes/gruvbox.lua diff --git a/modules/hosts/common/files/nvim/lua/disabled/themes/kanagawa.lua b/modules/shared/files/nvim/lua/disabled/themes/kanagawa.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/disabled/themes/kanagawa.lua rename to modules/shared/files/nvim/lua/disabled/themes/kanagawa.lua diff --git a/modules/hosts/common/files/nvim/lua/disabled/themes/oxocarbon.lua b/modules/shared/files/nvim/lua/disabled/themes/oxocarbon.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/disabled/themes/oxocarbon.lua rename to modules/shared/files/nvim/lua/disabled/themes/oxocarbon.lua diff --git a/modules/hosts/common/files/nvim/lua/disabled/themes/tokyonight.lua b/modules/shared/files/nvim/lua/disabled/themes/tokyonight.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/disabled/themes/tokyonight.lua rename to modules/shared/files/nvim/lua/disabled/themes/tokyonight.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/alpha.lua b/modules/shared/files/nvim/lua/plugins/alpha.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/alpha.lua rename to modules/shared/files/nvim/lua/plugins/alpha.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/bufferline.lua b/modules/shared/files/nvim/lua/plugins/bufferline.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/bufferline.lua rename to modules/shared/files/nvim/lua/plugins/bufferline.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/catppuccin.lua b/modules/shared/files/nvim/lua/plugins/catppuccin.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/catppuccin.lua rename to modules/shared/files/nvim/lua/plugins/catppuccin.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/completions.lua b/modules/shared/files/nvim/lua/plugins/completions.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/completions.lua rename to modules/shared/files/nvim/lua/plugins/completions.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/edgy.lua b/modules/shared/files/nvim/lua/plugins/edgy.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/edgy.lua rename to modules/shared/files/nvim/lua/plugins/edgy.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/git-stuff.lua b/modules/shared/files/nvim/lua/plugins/git-stuff.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/git-stuff.lua rename to modules/shared/files/nvim/lua/plugins/git-stuff.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/lsp-config.lua b/modules/shared/files/nvim/lua/plugins/lsp-config.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/lsp-config.lua rename to modules/shared/files/nvim/lua/plugins/lsp-config.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/lualine.lua b/modules/shared/files/nvim/lua/plugins/lualine.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/lualine.lua rename to modules/shared/files/nvim/lua/plugins/lualine.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/neo-tree.lua b/modules/shared/files/nvim/lua/plugins/neo-tree.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/neo-tree.lua rename to modules/shared/files/nvim/lua/plugins/neo-tree.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/noice.lua b/modules/shared/files/nvim/lua/plugins/noice.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/noice.lua rename to modules/shared/files/nvim/lua/plugins/noice.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/none-ls.lua b/modules/shared/files/nvim/lua/plugins/none-ls.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/none-ls.lua rename to modules/shared/files/nvim/lua/plugins/none-ls.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/nvim-web-devicons.lua b/modules/shared/files/nvim/lua/plugins/nvim-web-devicons.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/nvim-web-devicons.lua rename to modules/shared/files/nvim/lua/plugins/nvim-web-devicons.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/telescope.lua b/modules/shared/files/nvim/lua/plugins/telescope.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/telescope.lua rename to modules/shared/files/nvim/lua/plugins/telescope.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/todo-comments.lua b/modules/shared/files/nvim/lua/plugins/todo-comments.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/todo-comments.lua rename to modules/shared/files/nvim/lua/plugins/todo-comments.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/toggleterm.lua b/modules/shared/files/nvim/lua/plugins/toggleterm.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/toggleterm.lua rename to modules/shared/files/nvim/lua/plugins/toggleterm.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/treesitter.lua b/modules/shared/files/nvim/lua/plugins/treesitter.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/treesitter.lua rename to modules/shared/files/nvim/lua/plugins/treesitter.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/trouble.lua b/modules/shared/files/nvim/lua/plugins/trouble.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/trouble.lua rename to modules/shared/files/nvim/lua/plugins/trouble.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/vim-tmux-navigator.lua b/modules/shared/files/nvim/lua/plugins/vim-tmux-navigator.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/vim-tmux-navigator.lua rename to modules/shared/files/nvim/lua/plugins/vim-tmux-navigator.lua diff --git a/modules/hosts/common/files/nvim/lua/plugins/which-key.lua b/modules/shared/files/nvim/lua/plugins/which-key.lua similarity index 100% rename from modules/hosts/common/files/nvim/lua/plugins/which-key.lua rename to modules/shared/files/nvim/lua/plugins/which-key.lua diff --git a/modules/hosts/common/files/tilix/Beanbag-Mathias.json b/modules/shared/files/tilix/Beanbag-Mathias.json similarity index 100% rename from modules/hosts/common/files/tilix/Beanbag-Mathias.json rename to modules/shared/files/tilix/Beanbag-Mathias.json diff --git a/modules/hosts/common/files/waybar/config b/modules/shared/files/waybar/config similarity index 100% rename from modules/hosts/common/files/waybar/config rename to modules/shared/files/waybar/config diff --git a/modules/hosts/common/files/waybar/style.css b/modules/shared/files/waybar/style.css similarity index 100% rename from modules/hosts/common/files/waybar/style.css rename to modules/shared/files/waybar/style.css diff --git a/modules/hosts/common/files/xfce4/terminal/accels.scm b/modules/shared/files/xfce4/terminal/accels.scm similarity index 100% rename from modules/hosts/common/files/xfce4/terminal/accels.scm rename to modules/shared/files/xfce4/terminal/accels.scm diff --git a/modules/hosts/common/files/xfce4/terminal/terminalrc b/modules/shared/files/xfce4/terminal/terminalrc similarity index 100% rename from modules/hosts/common/files/xfce4/terminal/terminalrc rename to modules/shared/files/xfce4/terminal/terminalrc diff --git a/modules/hosts/common/all-gui.nix b/modules/shared/home/general/all-gui.nix similarity index 100% rename from modules/hosts/common/all-gui.nix rename to modules/shared/home/general/all-gui.nix diff --git a/modules/hosts/common/default.nix b/modules/shared/home/general/default.nix similarity index 97% rename from modules/hosts/common/default.nix rename to modules/shared/home/general/default.nix index 80d0f93..a33fc2d 100644 --- a/modules/hosts/common/default.nix +++ b/modules/shared/home/general/default.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, username, ... }: let +{ config, inputs, pkgs, ... }: let sqlite_lib = if builtins.elem pkgs.stdenv.hostPlatform.system [ "aarch64-darwin" "x86_64-darwin" @@ -166,7 +166,7 @@ in { }; nh = { enable = true; - flake = "/Users/${username}/repos/dots"; + flake = "${config.home.homeDirectory}/repos/dots"; }; oh-my-posh = { enable = true; @@ -353,14 +353,14 @@ in { home.file = { ".config/nvim/lua/config" = { - source = ./files/nvim/lua/config; + source = ../../files/nvim/lua/config; recursive = true; }; ".config/nvim/lua/plugins" = { - source = ./files/nvim/lua/plugins; + source = ../../files/nvim/lua/plugins; recursive = true; }; - ".config/powershell/Microsoft.PowerShell_profile.ps1".source = ./files/Microsoft.PowerShell_profile.ps1; - ".config/powershell/Microsoft.VSCode_profile.ps1".source = ./files/Microsoft.PowerShell_profile.ps1; + ".config/powershell/Microsoft.PowerShell_profile.ps1".source = ../../files/Microsoft.PowerShell_profile.ps1; + ".config/powershell/Microsoft.VSCode_profile.ps1".source = ../../files/Microsoft.PowerShell_profile.ps1; }; } diff --git a/modules/hosts/common/linux/apps/hexchat.nix b/modules/shared/home/linux/apps/hexchat.nix similarity index 100% rename from modules/hosts/common/linux/apps/hexchat.nix rename to modules/shared/home/linux/apps/hexchat.nix diff --git a/modules/hosts/common/linux/apps/pidgin.nix b/modules/shared/home/linux/apps/pidgin.nix similarity index 100% rename from modules/hosts/common/linux/apps/pidgin.nix rename to modules/shared/home/linux/apps/pidgin.nix diff --git a/modules/hosts/common/linux/apps/tilix.nix b/modules/shared/home/linux/apps/tilix.nix similarity index 96% rename from modules/hosts/common/linux/apps/tilix.nix rename to modules/shared/home/linux/apps/tilix.nix index bd7433c..b8fa94a 100644 --- a/modules/hosts/common/linux/apps/tilix.nix +++ b/modules/shared/home/linux/apps/tilix.nix @@ -19,7 +19,7 @@ }; home.file = { - ".config/tilix/schemes/Beanbag-Mathias.json".source = ../../files/tilix/Beanbag-Mathias.json; + ".config/tilix/schemes/Beanbag-Mathias.json".source = ../../../files/tilix/Beanbag-Mathias.json; ".config/tilix/schemes/Catppuccin-Frappe.json".source = (pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "tilix"; diff --git a/modules/hosts/common/linux/apps/waybar.nix b/modules/shared/home/linux/apps/waybar.nix similarity index 74% rename from modules/hosts/common/linux/apps/waybar.nix rename to modules/shared/home/linux/apps/waybar.nix index 3fdd87a..b48c3be 100644 --- a/modules/hosts/common/linux/apps/waybar.nix +++ b/modules/shared/home/linux/apps/waybar.nix @@ -1,13 +1,13 @@ { pkgs, ... }: { home.file = { - ".config/waybar/config".source = ../../files/waybar/config; + ".config/waybar/config".source = ../../../files/waybar/config; ".config/waybar/frappe.css".source = (pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "waybar"; rev = "f74ab1eecf2dcaf22569b396eed53b2b2fbe8aff"; hash = "sha256-WLJMA2X20E5PCPg0ZPtSop0bfmu+pLImP9t8A8V4QK8="; } + "/themes/frappe.css"); - ".config/waybar/style.css".source = ../../files/waybar/style.css; + ".config/waybar/style.css".source = ../../../files/waybar/style.css; }; programs = { diff --git a/modules/hosts/common/linux/apps/xfce4-terminal.nix b/modules/shared/home/linux/apps/xfce4-terminal.nix similarity index 94% rename from modules/hosts/common/linux/apps/xfce4-terminal.nix rename to modules/shared/home/linux/apps/xfce4-terminal.nix index 6b49e4d..d3e67fc 100644 --- a/modules/hosts/common/linux/apps/xfce4-terminal.nix +++ b/modules/shared/home/linux/apps/xfce4-terminal.nix @@ -1,6 +1,6 @@ { ... }: { home.file = { - ".config/xfce4/terminal/accels.scm".source = ../../files/xfce4/terminal/accels.scm; + ".config/xfce4/terminal/accels.scm".source = ../../../files/xfce4/terminal/accels.scm; }; xfconf.settings = { diff --git a/modules/hosts/common/linux/home.nix b/modules/shared/home/linux/default.nix similarity index 100% rename from modules/hosts/common/linux/home.nix rename to modules/shared/home/linux/default.nix diff --git a/modules/hosts/common/linux/flatpaks.nix b/modules/shared/nixos/flatpaks.nix similarity index 100% rename from modules/hosts/common/linux/flatpaks.nix rename to modules/shared/nixos/flatpaks.nix diff --git a/modules/hosts/common/linux/internationalisation.nix b/modules/shared/nixos/internationalisation.nix similarity index 100% rename from modules/hosts/common/linux/internationalisation.nix rename to modules/shared/nixos/internationalisation.nix diff --git a/modules/hosts/common/linux/lets-encrypt.nix b/modules/shared/nixos/lets-encrypt.nix similarity index 100% rename from modules/hosts/common/linux/lets-encrypt.nix rename to modules/shared/nixos/lets-encrypt.nix diff --git a/modules/hosts/common/linux/nixroutes.nix b/modules/shared/nixos/nixroutes.nix similarity index 100% rename from modules/hosts/common/linux/nixroutes.nix rename to modules/shared/nixos/nixroutes.nix diff --git a/modules/hosts/common/linux/restic.nix b/modules/shared/nixos/restic.nix similarity index 100% rename from modules/hosts/common/linux/restic.nix rename to modules/shared/nixos/restic.nix diff --git a/modules/hosts/common/linux/ripping.nix b/modules/shared/nixos/ripping.nix similarity index 100% rename from modules/hosts/common/linux/ripping.nix rename to modules/shared/nixos/ripping.nix diff --git a/modules/hosts/common/secrets.yaml b/modules/shared/secrets.yaml similarity index 100% rename from modules/hosts/common/secrets.yaml rename to modules/shared/secrets.yaml