From 7d484f0e61df24d94481d6f3bfef9fcdff792eb0 Mon Sep 17 00:00:00 2001 From: Natasha Moongrave Date: Fri, 12 Jun 2026 14:08:25 +0200 Subject: Updated and streamlined the flake Added nixos-hardware for some more streamlines system specific configuration and edge cases, as well as added agenix for secret storage --- flake.nix | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3662ed9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,160 @@ +{ + description = "NixOS config (clean direct flake)"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; # nixpkgs stable; used as the default source for all packages. + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # unstable for when stable is too behind (called by prefixing the pkg with 'unstable.') + + home-manager = { + # NixOS home-manager + url = "github:nix-community/home-manager/release-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + stylix = { + # Colorscheme and general style handling + url = "github:danth/stylix/release-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + fenix = { + # Rust tool-chain handler + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + + nixcord.url = "github:FlameFlag/nixcord"; # NixOS discord flake + + nixos-hardware.url = "github:NixOS/nixos-hardware"; # NixOS hardware flake for simpler system specific optimisation + agenix = { + url = "github:ryantm/agenix"; + nixpkgs.follows = "nixpkgs"; + # choose not to download darwin deps (saves some resources on Linux) + darwin.follows = ""; + }; + }; + + outputs = inputs @ { + self, + nixpkgs, + nixpkgs-unstable, + home-manager, + stylix, + fenix, + nixos-hardware, + agenix, + ... + }: let + system = "x86_64-linux"; + + overlays = [ + (final: prev: { + unstable = import nixpkgs-unstable { + # handle the unstable prefix + inherit system; + config.allowUnfree = true; + }; + }) + + fenix.overlays.default + ]; + in { + nixosConfigurations = { + ##################################### MYSTRA X220 MAIN LAPTOP (HARDENED) ##################################### + mystra = nixpkgs.lib.nixosSystem { + inherit system; + + specialArgs = {inherit inputs;}; + + modules = [ + { + nixpkgs = { + inherit overlays; + config.allowUnfree = true; + }; + } + + nixos-hardware.nixosModules.lenovo-thinkpad-x220 + agenix.nixosModules.default + agenix.homeManagerModules.default # Install the agenix hM module aswell + + ./hosts/mystra/configuration.nix + ./system + + stylix.nixosModules.stylix + home-manager.nixosModules.home-manager + + { + home-manager.users.mun.imports = [ + ./home/mun + ./home/rices/schrottkatze/home.nix + ]; + } + ]; + }; + ##################################### HERRA HOME WORKSTATION ##################################### + herra = nixpkgs.lib.nixosSystem { + inherit system; + + specialArgs = {inherit inputs;}; + + modules = [ + { + nixpkgs = { + inherit overlays; + config.allowUnfree = true; + }; + } + + # TODO: Add amd gpu and intel cpu nixosnixos-hardware configs + agenix.nixosModules.default + agenix.homeManagerModules.default # Install the agenix hM module aswell + + ./hosts/herra/configuration.nix + ./system + + stylix.nixosModules.stylix + home-manager.nixosModules.home-manager + + { + home-manager.users.mun.imports = [ + ./home/mun + ./home/rices/cinnamon/home.nix + ]; + } + ]; + }; + ##################################### KRONOS HP ELITEBOOK CURRENT MAIN (BACKUP, HARDENED) LAPTOP ##################################### + kronos = nixpkgs.lib.nixosSystem { + inherit system; + + specialArgs = {inherit inputs;}; + + modules = [ + { + nixpkgs = { + inherit overlays; + config.allowUnfree = true; + }; + } + nixos-hardware.nixosModules.hp-elitebook-830g6 + agenix.nixosModules.default + agenix.homeManagerModules.default # Install the agenix hM module aswell + + ./hosts/kronos/configuration.nix + ./system + + stylix.nixosModules.stylix + home-manager.nixosModules.home-manager + + { + home-manager.users.mun.imports = [ + ./home/mun + ./home/rices/nord-blue/home.nix + ]; + } + ]; + }; + }; + }; +} -- cgit v1.2.3