diff --git a/flake.lock b/flake.lock index cd3f169..9e58a48 100644 --- a/flake.lock +++ b/flake.lock @@ -1,24 +1,183 @@ { "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748294338, + "narHash": "sha256-FVO01jdmUNArzBS7NmaktLdGA5qA3lUMJ4B7a05Iynw=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "cc5f390f7caf265461d4aab37e98d2292ebbdb85", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.0.8", + "repo": "ixx", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1748437600, "narHash": "sha256-hYKMs3ilp09anGO7xzfGs3JqEgUqFMnZ8GMAqI6/k04=", - "owner": "nixos", + "owner": "NixOS", "repo": "nixpkgs", "rev": "7282cb574e0607e65224d33be8241eae7cfe0979", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1748437600, + "narHash": "sha256-hYKMs3ilp09anGO7xzfGs3JqEgUqFMnZ8GMAqI6/k04=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7282cb574e0607e65224d33be8241eae7cfe0979", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_2", + "nuschtosSearch": "nuschtosSearch", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1748695667, + "narHash": "sha256-oztcrhUwXAqPRBqyh9yJo6Ymiu4T94MdPARa/fTw75I=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "82fafc9f9f89b54e13cff3c51582b6c228ec8331", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "nixos-25.05", + "repo": "nixvim", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748298102, + "narHash": "sha256-PP11GVwUt7F4ZZi5A5+99isuq39C59CKc5u5yVisU/U=", + "owner": "NuschtOS", + "repo": "search", + "rev": "f8a1c221afb8b4c642ed11ac5ee6746b0fe1d32f", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixvim": "nixvim" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index a7e76c9..e1525bb 100644 --- a/flake.nix +++ b/flake.nix @@ -2,25 +2,31 @@ description = "All system configurations for Vili Sinervä"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + nixvim.url = "github:nix-community/nixvim/nixos-25.05"; }; outputs = - inputs@{ nixpkgs, ... }: + { nixpkgs, nixvim, ... }: { nixosConfigurations = ( let - hosts = map (name: (nixpkgs.lib.removeSuffix ".nix" name)) ( - builtins.attrNames (builtins.readDir ./hosts) - ); + hosts = builtins.attrNames (builtins.readDir ./hosts); in builtins.listToAttrs ( map ( host: nixpkgs.lib.nameValuePair host ( nixpkgs.lib.nixosSystem { + specialArgs = { + inherit nixpkgs; + inherit nixvim; + }; system = "x86_64-linux"; - modules = [ ./hosts/${host}.nix ]; + modules = [ + ./hosts/${host}/configuration.nix + ./hosts/${host}/hardware-configuration.nix + ]; } ) ) hosts diff --git a/hosts/cert-store.nix b/hosts/cert-store/configuration.nix similarity index 57% rename from hosts/cert-store.nix rename to hosts/cert-store/configuration.nix index ab00e96..a9051ef 100644 --- a/hosts/cert-store.nix +++ b/hosts/cert-store/configuration.nix @@ -1,10 +1,10 @@ -{ pkgs, ... }: +{ ... }: { networking.hostName = "cert-store"; imports = [ - ../shared/base.nix - ../servers/acme-cert-store.nix + ../../shared/base.nix + ../../servers/acme-cert-store.nix ]; services.qemuGuest.enable = true; diff --git a/hosts/exoplasim.nix b/hosts/exoplasim/configuration.nix similarity index 97% rename from hosts/exoplasim.nix rename to hosts/exoplasim/configuration.nix index ca9bf4f..ac7bbf0 100644 --- a/hosts/exoplasim.nix +++ b/hosts/exoplasim/configuration.nix @@ -5,7 +5,7 @@ ... }: { - imports = [ ../shared/base.nix ]; + imports = [ ../../shared/base.nix ]; # Networking conf including WireGuard networking = { diff --git a/hosts/forgejo.nix b/hosts/forgejo/configuration.nix similarity index 100% rename from hosts/forgejo.nix rename to hosts/forgejo/configuration.nix diff --git a/hosts/gaming.nix b/hosts/gaming/configuration.nix similarity index 56% rename from hosts/gaming.nix rename to hosts/gaming/configuration.nix index 42831cc..c7ac7ab 100644 --- a/hosts/gaming.nix +++ b/hosts/gaming/configuration.nix @@ -3,12 +3,12 @@ networking.hostName = "gaming"; imports = [ - ../shared/base.nix - ../shared/hardware/nvidia.nix + ../../shared/base.nix + ../../shared/hardware/nvidia.nix - ../personal/desktop.nix + ../../personal/desktop.nix - ../servers/gaming-server.nix + ../../servers/gaming-server.nix ]; users.users.vili.hashedPasswordFile = lib.mkForce null; diff --git a/hosts/helium.nix b/hosts/helium/configuration.nix similarity index 65% rename from hosts/helium.nix rename to hosts/helium/configuration.nix index e75323f..80d3859 100644 --- a/hosts/helium.nix +++ b/hosts/helium/configuration.nix @@ -46,27 +46,27 @@ }; imports = [ - ../shared/base.nix + ../../shared/base.nix - ../personal/desktop.nix - ../personal/development.nix + ../../personal/desktop.nix + ../../personal/development.nix - ../personal/hardware/amd-laptop.nix - ../personal/hardware/hibernate.nix - ../personal/hardware/keychron-q11.nix - ../personal/hardware/onlykey.nix - ../personal/hardware/trackball.nix + ../../personal/hardware/amd-laptop.nix + ../../personal/hardware/hibernate.nix + ../../personal/hardware/keychron-q11.nix + ../../personal/hardware/onlykey.nix + ../../personal/hardware/trackball.nix - ../personal/networking/home-wg.nix - ../personal/networking/printing.nix + ../../personal/networking/home-wg.nix + ../../personal/networking/printing.nix - ../personal/programs/bitwarden.nix - ../personal/programs/communication.nix - ../personal/programs/firefox.nix - ../personal/programs/i3.nix - ../personal/programs/moonlight.nix - ../personal/programs/redshift.nix - ../personal/programs/study.nix - ../personal/programs/usb-automount.nix + ../../personal/programs/bitwarden.nix + ../../personal/programs/communication.nix + ../../personal/programs/firefox.nix + ../../personal/programs/i3.nix + ../../personal/programs/moonlight.nix + ../../personal/programs/redshift.nix + ../../personal/programs/study.nix + ../../personal/programs/usb-automount.nix ]; } diff --git a/hosts/idacloud.nix b/hosts/idacloud/configuration.nix similarity index 94% rename from hosts/idacloud.nix rename to hosts/idacloud/configuration.nix index 4583c26..49c26d4 100644 --- a/hosts/idacloud.nix +++ b/hosts/idacloud/configuration.nix @@ -5,8 +5,8 @@ custom.collabora_domain = "idacollab.sinerva.eu"; imports = [ - ../shared/base.nix - ../servers/nextcloud.nix + ../../shared/base.nix + ../../servers/nextcloud.nix ]; # Networking conf including WireGuard diff --git a/hosts/lithium.nix b/hosts/lithium.nix deleted file mode 100644 index 9faf260..0000000 --- a/hosts/lithium.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib, ... }: -{ - system.stateVersion = 24.05; - networking.hostName = "lithium"; - - custom.home_wg_suffix = "3"; - system.autoUpgrade.allowReboot = lib.mkForce false; - # boot.kernelParams = [ "resume_offset=39292928" ]; - - imports = [ - ../shared/base.nix - - ../personal/desktop.nix - ../personal/development.nix - - ../personal/hardware/hibernate.nix - ../personal/hardware/intel-laptop.nix - ../personal/hardware/onlykey.nix - - ../personal/networking/home-wg.nix - ../personal/networking/printing.nix - - ../personal/programs/bitwarden.nix - ../personal/programs/communication.nix - ../personal/programs/firefox.nix - ../personal/programs/i3.nix - ../personal/programs/moonlight.nix - ../personal/programs/redshift.nix - ../personal/programs/study.nix - ../personal/programs/usb-automount.nix - ]; -} diff --git a/hosts/lithium/configuration.nix b/hosts/lithium/configuration.nix new file mode 100644 index 0000000..e1e3d75 --- /dev/null +++ b/hosts/lithium/configuration.nix @@ -0,0 +1,32 @@ +{ lib, ... }: +{ + system.stateVersion = 24.05; + networking.hostName = "lithium"; + + custom.home_wg_suffix = "3"; + system.autoUpgrade.allowReboot = lib.mkForce false; + # boot.kernelParams = [ "resume_offset=39292928" ]; + + imports = [ + ../../shared/base.nix + + ../../personal/desktop.nix + ../../personal/development.nix + + ../../personal/hardware/hibernate.nix + ../../personal/hardware/intel-laptop.nix + ../../personal/hardware/onlykey.nix + + ../../personal/networking/home-wg.nix + ../../personal/networking/printing.nix + + ../../personal/programs/bitwarden.nix + ../../personal/programs/communication.nix + ../../personal/programs/firefox.nix + ../../personal/programs/i3.nix + ../../personal/programs/moonlight.nix + ../../personal/programs/redshift.nix + ../../personal/programs/study.nix + ../../personal/programs/usb-automount.nix + ]; +} diff --git a/hosts/nextcloud.nix b/hosts/nextcloud/configuration.nix similarity index 75% rename from hosts/nextcloud.nix rename to hosts/nextcloud/configuration.nix index fd95659..028dc5b 100644 --- a/hosts/nextcloud.nix +++ b/hosts/nextcloud/configuration.nix @@ -4,8 +4,8 @@ custom.nextcloud_domain = "nextcloud.vsinerva.fi"; imports = [ - ../shared/base.nix - ../servers/nextcloud.nix + ../../shared/base.nix + ../../servers/nextcloud.nix ]; # HARDWARE SPECIFIC diff --git a/hosts/nixos.nix b/hosts/nixos/configuration.nix similarity index 87% rename from hosts/nixos.nix rename to hosts/nixos/configuration.nix index 13f5b80..c73a14e 100644 --- a/hosts/nixos.nix +++ b/hosts/nixos/configuration.nix @@ -2,7 +2,7 @@ { networking.hostName = "nixos"; - imports = [ ../shared/base.nix ]; + imports = [ ../../shared/base.nix ]; #Many installs will need this, and it won't hurt either way services.qemuGuest.enable = true; diff --git a/hosts/siit-dc.nix b/hosts/siit-dc/configuration.nix similarity index 69% rename from hosts/siit-dc.nix rename to hosts/siit-dc/configuration.nix index 7829155..40ca9b0 100644 --- a/hosts/siit-dc.nix +++ b/hosts/siit-dc/configuration.nix @@ -3,8 +3,8 @@ networking.hostName = "siit-dc"; imports = [ - ../shared/base.nix - ../servers/siit-dc.nix + ../../shared/base.nix + ../../servers/siit-dc.nix ]; # HARDWARE SPECIFIC diff --git a/hosts/syncthing.nix b/hosts/syncthing/configuration.nix similarity index 68% rename from hosts/syncthing.nix rename to hosts/syncthing/configuration.nix index 5830269..f026176 100644 --- a/hosts/syncthing.nix +++ b/hosts/syncthing/configuration.nix @@ -3,10 +3,10 @@ networking.hostName = "syncthing"; imports = [ - ../shared/base.nix - ../shared/users/vili.nix + ../../shared/base.nix + ../../shared/users/vili.nix - ../servers/syncthing.nix + ../../servers/syncthing.nix ]; users.users.vili.hashedPasswordFile = lib.mkForce null; diff --git a/hosts/vaultwarden.nix b/hosts/vaultwarden/configuration.nix similarity index 68% rename from hosts/vaultwarden.nix rename to hosts/vaultwarden/configuration.nix index 4bc39c3..548cb7d 100644 --- a/hosts/vaultwarden.nix +++ b/hosts/vaultwarden/configuration.nix @@ -3,8 +3,8 @@ networking.hostName = "vaultwarden"; imports = [ - ../shared/base.nix - ../servers/vaultwarden.nix + ../../shared/base.nix + ../../servers/vaultwarden.nix ]; # HARDWARE SPECIFIC diff --git a/hosts/wg-rpi.nix b/hosts/wg-rpi/configuration.nix similarity index 98% rename from hosts/wg-rpi.nix rename to hosts/wg-rpi/configuration.nix index c456a75..afe65be 100644 --- a/hosts/wg-rpi.nix +++ b/hosts/wg-rpi/configuration.nix @@ -8,7 +8,7 @@ let ddPassFile = "/root/wg-conf/ddPassFile"; in { - imports = [ ../shared/base.nix ]; + imports = [ ../../shared/base.nix ]; environment.systemPackages = with pkgs; [ wireguard-tools diff --git a/personal/desktop.nix b/personal/desktop.nix index c3fa830..9227521 100644 --- a/personal/desktop.nix +++ b/personal/desktop.nix @@ -1,8 +1,8 @@ { pkgs, ... }: { imports = [ - ./symlinked/symlinks.nix - ../shared/users/vili + ./programs/symlinked/symlinks.nix + ../shared/users/vili.nix ]; environment.systemPackages = with pkgs; [ diff --git a/personal/programs/embedded/nvim.nix b/personal/programs/embedded/nvim.nix index 7d329fc..fbdd0d3 100644 --- a/personal/programs/embedded/nvim.nix +++ b/personal/programs/embedded/nvim.nix @@ -1,12 +1,4 @@ -{ ... }: -let - nixvim = import ( - builtins.fetchGit { - url = "https://github.com/nix-community/nixvim"; - ref = "nixos-25.05"; - } - ); -in +{ nixvim, ... }: { imports = [ nixvim.nixosModules.nixvim ]; diff --git a/shared/base.nix b/shared/base.nix index 39c7da8..b81ab93 100644 --- a/shared/base.nix +++ b/shared/base.nix @@ -1,12 +1,10 @@ { pkgs, lib, - inputs, + nixpkgs, ... }: { - imports = [ /etc/nixos/hardware-configuration.nix ]; - options.custom.gua_pref = lib.mkOption { type = with lib.types; nullOr (strMatching "^[0-9a-zA-Z:]+$"); default = null; @@ -148,7 +146,7 @@ nix = { registry = { - nixpkgs.flake = inputs.nixpkgs; + nixpkgs.flake = nixpkgs; }; settings = { experimental-features = [