diff --git a/flake.nix b/flake.nix index 78ff829..e6fbc84 100755 --- a/flake.nix +++ b/flake.nix @@ -4,40 +4,60 @@ inputs = { - # Nixpkgs version - https://github.com/NixOS/nixpkgs - nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; }; + # nix hardware - https://github.com/NixOS/nixos-hardware + hardware = { + url = "github:nixos/nixos-hardware"; + }; - # NixOS hardware - https://github.com/NixOS/nixos-hardware - hardware = { url = "github:nixos/nixos-hardware"; }; + # nixpkgs version - https://github.com/NixOS/nixpkgs + nixpkgs = { + url = "github:nixos/nixpkgs/nixos-unstable"; + }; - # Dendritic stuff - https://www.vimjoyer.com/vid79-parts-wrapped - flake-parts = { url = "github:hercules-ci/flake-parts"; }; - flake-utils = { url = "github:numtide/flake-utils"; }; - import-tree = { url = "github:vic/import-tree"; }; - wrapper-modules = { url = "github:BirdeeHub/nix-wrapper-modules";}; - den = { url = "github:vic/den/v0.17.0"; }; + # dendritic stuff - https://www.vimjoyer.com/vid79-parts-wrapped + den = { + url = "github:vic/den/v0.17.0"; + }; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + }; + flake-utils = { + url = "github:numtide/flake-utils"; + }; + import-tree = { + url = "github:vic/import-tree"; + }; + wrapper-modules = { + url = "github:BirdeeHub/nix-wrapper-modules"; + }; - # Secrets management - https://github.com/Mic92/sops-nix + # sound driver optimisations - https://github.com/musnix/musnix + musnix = { + url = "github:musnix/musnix"; + }; + + # nice-to-haves for gaming - https://github.com/fufexan/nix-gaming + nix-gaming = { + url = "github:fufexan/nix-gaming"; + }; + + # secrets management - https://github.com/Mic92/sops-nix #sops-nix = { url = "github:Mic92/sops-nix"; }; - # Zoomer text editor - https://github.com/notashelf/nvf - nvf = { url = "github:notashelf/nvf"; }; - - # Sound driver optimisations - https://github.com/musnix/musnix - musnix = { url = "github:musnix/musnix"; }; - - # Nice-to-haves for gaming - https://github.com/fufexan/nix-gaming - nix-gaming = { url = "github:fufexan/nix-gaming"; }; - - - # Declarative dots - https://github.com/nix-community/home-manager + # declarative dots - https://github.com/nix-community/home-manager home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - # Niri window manager - https://github.com/YaLTeR/niri - niri = { # - https://github.com/sodiboo/niri-flake/ + # easy theming - https://github.com/nix-community/stylix + stylix = { + url = "github:danth/stylix"; + }; + + # niri window manager - https://github.com/YaLTeR/niri + # niri flake docs - https://github.com/sodiboo/niri-flake/ + niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; #inputs.niri-unstable.follows = ""; @@ -46,19 +66,23 @@ #inputs.xwayland-satellite-stable.follows = ""; }; - # Hassle free desktop shell - https://docs.noctalia.dev/getting-started/nixos/ - noctalia = { + # hassle free desktop shell - https://docs.noctalia.dev/getting-started/nixos/ + noctalia = { url = "github:noctalia-dev/noctalia-shell"; inputs.nixpkgs.follows = "nixpkgs"; }; - # Easy theming - https://github.com/nix-community/stylix - stylix = { url = "github:danth/stylix"; }; - }; - outputs = inputs: inputs.flake-parts.lib.mkFlake - {inherit inputs; } - (inputs.import-tree ./modules); -} + # flake entry point + outputs = + inputs: + inputs.flake-parts.lib.mkFlake + # pass inputs to modules + { inherit inputs; } + + # where to find modules? + (inputs.import-tree ./modules); + +} diff --git a/resources/maintenance/boilerplate/boilerplate.nix b/resources/maintenance/boilerplate/boilerplate.nix index 72912a9..6812942 100644 --- a/resources/maintenance/boilerplate/boilerplate.nix +++ b/resources/maintenance/boilerplate/boilerplate.nix @@ -1,19 +1,28 @@ -{ inputs, ... }: +{ inputs, ... }: +# let bindings let + #foo = bar -in + # + +in { - # Try `$ nix run .#boilerplate` + # try `$ nix run .#boilerplate` flake = { + # modules declaration nixosConfigurations.main = inputs.nixpkgs.lib.nixosSystem { + + # list of modules to import modules = [ ./configuration.nix ]; + }; }; + } diff --git a/resources/maintenance/boilerplate/myFirstModule.nix b/resources/maintenance/boilerplate/myFirstModule.nix index 10921dd..58ea2e7 100644 --- a/resources/maintenance/boilerplate/myFirstModule.nix +++ b/resources/maintenance/boilerplate/myFirstModule.nix @@ -1,11 +1,14 @@ -{inputs, ... }: { +{ inputs, ... }: { + # module declaration flake.nixosModules.myFirstModule = { pkgs, ... }: { + # options declarations programs.firefox.enable = true; + # packages to include environment.systemPackages = with pkgs; [ - vim + helix ]; }; diff --git a/resources/maintenance/boilerplate/myMachine.nix b/resources/maintenance/boilerplate/myMachine.nix index e84803d..3b9f525 100644 --- a/resources/maintenance/boilerplate/myMachine.nix +++ b/resources/maintenance/boilerplate/myMachine.nix @@ -1,25 +1,27 @@ { inputs, self, ... }: { - + # module declaration flake.nixosConfigurations.myMachine = inputs.nixpkgs.lib.nixosSystem { + # modules to import modules = with self; [ - nixosModules.myMachineModule + nixosModules.myMachineModule nixosModules.myFirstModule ]; }; - + # module declaration flake.nixosModules.myMachineModule = { pkgs, ... }: { + # options declarations boot.loader.grub.enable = true; + # packages to import environment.systemPackages = with self; [ packages.${pkgs.system}.myPackage ]; }; - } diff --git a/resources/maintenance/boilerplate/myPackage.nix b/resources/maintenance/boilerplate/myPackage.nix index 8d2229b..40e532c 100644 --- a/resources/maintenance/boilerplate/myPackage.nix +++ b/resources/maintenance/boilerplate/myPackage.nix @@ -1,12 +1,17 @@ { inputs, ... }: { + # packages declaration perSystem = { pkgs, ... }: { + + #package declaration packages.myPackage = pkgs.stdenv.mkDerivation { + # package options pname = "myPackage"; version = "0.0.1"; }; + }; }