testing nosh
README.md

About #

This is a fork of nosh with my own preferred setup constrictions

Differences #

  • forces passed pkgs to be readonly nixpkgs.pkgs = pkgs so you can't change config of it in anyway in the module system.
  • rename enabled condition to enable because who the fuck though enabled should exist as a word
  • delete unused by me code
  • use updated recursive script from llakala
  • have starting with _ file names be ignored
  • have path to module be present in error messages instead of referring to mkSystem
  • nixosSystem renamed to eval because tbh, if you setup eval for each host, you can have much more than just nixos configs. Stolen from prism, another of Poacher's projects

Tip #

Because of all my changes, the nosh.lib.mkSystem might have end up looking kinda ugly. That's why I wrote a function to make it appear nicely in my flake.nix

      nixosConfigurations =
        let
          # helper function
          make =
            {
              # predefined variables with most common defaults
              host,
              system ? "x86_64-linux",
              rocm ? false,
              cuda ? false,
              eval ? inputs.nixpkgs.lib.nixosSystem,
            }:
            mkSystem {
              specialArgs = { inherit inputs self; };
              paths = [ ./modules ];
              modules = [ ./options ];
              conditions = nosh.conditions.hasHost host;
              pkgs = import inputs.nixpkgs {
                inherit system;
                # to create each pkgs for specific host
                config = { allowUnfree = true; rocmSupport = rocm; cudaSupport = cuda; };
              };
              inherit eval;
            };
        in
        {
          # the actual outputs, not the prettiest thing in the world, but manageable
          NixOSu = make { host = "pc"; rocm = true; };
          NixPort = make { host = "laptop"; rocm = true; };
          NixBox = make { host = "server"; };
          NixWool = make { host = "vps"; systems = "aarch64-linux"; };
          NixwsL = make { host = "wsl"; };
          NixIso = make { host = "iso"; };
          NixTest = make { host = "testing"; };
          FinixOSu = make { host = "finix"; eval = inputs.finix.lib.finixSystem; };
        };

Credits #

thanks @poacher, your lib is truly fucking awesome. I'd kiss you for creation of this, no homo