diff --git a/flake.nix b/flake.nix index 5ccb11d..d6c5150 100644 --- a/flake.nix +++ b/flake.nix @@ -242,9 +242,15 @@ }; }; - # TODO rewrite this so it follows the same wrapper pattern as mkHome - # This function produces a nixosSystem which imports configuration.nix and - # a Home Manager home.nix for the given user from ./hosts/${hostname}/ + # TODO rewrite this so it follows the same wrapper pattern as + # mkHome This function produces a nixosSystem which imports + # configuration.nix and a Home Manager home.nix for the given user + # from ./hosts/${hostname}/ + # + # nevermind i am migrating everything to flake-parts, i'm glad i + # never got around to this. i think the module system takes care of + # whatever the fuck godforsaken use-case i had for rewriting this + # (more ergonomic and/or default arguments or something). mkSystemN = let _username = username; _overlays = overlays; diff --git a/flake/TODO.md b/flake/TODO.md new file mode 100644 index 0000000..5cb19b4 --- /dev/null +++ b/flake/TODO.md @@ -0,0 +1,31 @@ +# flake-parts TODO + +- Move logic for generating system/home configs to module (most important, + reason i wanted to use flake-parts) + - Move common default args from the awful wrapper function to dedicated options: + - default module imports + - "common" module + - currently defines stateVersion, nixpkgs.config.allowUnfree, a few others + - make default module path configurable, but still default to + `./hosts/${hostname}/configuration.nix` + - make "entrypoint" (`./system`, `./home/standalone.nix`, etc) configurable + - make nixfiles home manager initialization a configurable option + - specialArgs (i want to deprecate this but one thing at a time) + - define system "types" and generate all of them internally using lazy + eval. export a specific one to the flake outputs. + - generate as something like `nixfiles.hosts..outputs` + - `flake.nixosConfigurations.` is set from `nixfiles.hosts..output` + - default chosen by option like `nixfiles.hosts..type` + - types: + - normal + - WSL + - ISO image + - define deploy-rs outputs in same section as hosts + - make common, central interface for configuring overlays to be consumed by + various parts of flake, move hard-coded overlays out of common module + - literally just a list, maybe process it using lib.composeManyExtensions +- some top-level config is okay (e.g., defining hosts using nixfiles options). + hide away all of the internal logic into imported modules. +- move random functions into nixfiles lib +- move top-level universal configs (username, mobileTimeZone) into option + (honestly, this alone makes flake-parts worth it) diff --git a/system/default.nix b/system/default.nix index c36974c..b5abfb5 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,4 +1,8 @@ { pkgs, config, lib, options, nixpkgs, home-manager, inputs, utils, ... }@args: +# ^ all these args are yucky and non-portable, replace them with a module +# called from the scope of the flake that brings relevant +# inputs/outputs/overlays/etc into scope. this might even make nixfiles +# portable (it still shouldn't be imported by other flakes probably) let cfg = config.nixfiles; flakeType = cfg.lib.types.flake;