summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix160
1 files changed, 160 insertions, 0 deletions
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
+ ];
+ }
+ ];
+ };
+ };
+ };
+}