diff --git a/flake.nix b/flake.nix index d38391f..466ed16 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,4 @@ { - inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11"; nur.url = "github:nix-community/NUR"; @@ -10,7 +9,11 @@ }; }; - outputs = {self, nixpkgs, home-manager, nur, ...}: { + outputs = {self, nixpkgs, home-manager, nur, ...}: + let + packages = import ./pkgs; + in + { nixosConfigurations.posixlycorrect = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ( import ./base ) ]; @@ -18,12 +21,16 @@ homeConfigurations."fabian@posixlycorrect" = home-manager.lib.homeManagerConfiguration { system = "x86_64-linux"; - configuration = import ./home {inherit nixpkgs;}; + configuration = import ./home {inherit self nixpkgs;}; username = "fabian"; homeDirectory = "/home/fabian"; stateVersion = "21.11"; }; - packages.x86_64-linux = import ./pkgs nixpkgs.legacyPackages.x86_64-linux; + packages.x86_64-linux = packages nixpkgs.legacyPackages.x86_64-linux; + + overlay = self: super: { + local = packages super; + }; }; } diff --git a/home/default.nix b/home/default.nix index df49f82..9ab714f 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,8 +1,10 @@ # man page: https://rycee.gitlab.io/home-manager/options.html -{ nixpkgs }: -{ config, pkgs, lib, ... }: { +{ nixpkgs, self }: +{ config, pkgs, lib, ... }: with lib; { + nixpkgs.overlays = [ self.overlay ]; + imports = [ ./steam ]; home = { @@ -14,6 +16,11 @@ "EDITOR" = "nvim"; "TERMINAL" = "kitty"; }; + file = { + ".shenvs".text = let + keeps = { gcKeep ? [] }: concatStringsSep "\n" (map toString gcKeep); + in keeps (import ../shenvs/config.nix pkgs.local.shenvs); + }; }; systemd.user.tmpfiles.rules = [ diff --git a/pkgs/default.nix b/pkgs/default.nix index 25e514e..1a9cfe8 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -16,7 +16,7 @@ with pkgs.lib; let value = import (root + "/${name}"); }; in - mapAttrs' entry (filterAttrs isMatch (readDir root)); + mapAttrs' entry (filterAttrs isMatch (builtins.readDir root)); in { shenvs = let diff --git a/shenvs/config.nix b/shenvs/config.nix new file mode 100644 index 0000000..722e773 --- /dev/null +++ b/shenvs/config.nix @@ -0,0 +1,5 @@ +shenvs: { + gcKeep = with shenvs; [ + armasm + ]; +}