diff --git a/flake.nix b/flake.nix index b978fb079b5ea6c2517f9fc7b78e3b54221a9f5e..50b132e138ceaad1dcc8fe9e812193860cabb3e4 100644 --- a/flake.nix +++ b/flake.nix @@ -125,23 +125,29 @@ }) inputs.golink.overlay ]; url = "github:nix-community/home-manager"; - - inherit overlays; - system = "x86_64-linux"; - config.allowUnfree = true; - }; - url = "github:nix-community/home-manager"; home-manager = { file = path; owner = username; }; - inputs.nixpkgs.follows = "nixpkgs"; + description = "jolheiser's nixos config"; + inputs.nixpkgs.follows = "nixpkgs"; config = { nixpkgs.overlays = overlays; # TODO Remove when apps are updated nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ]; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.${username}.imports = + if gui + then [./apps/gui] + else [./apps/nogui]; + extraSpecialArgs = { + flakePath = "/home/${username}/.config/nixpkgs"; + }; + }; age.secrets = { ssh-config = userSecret ./secrets/shared/ssh-config.age; ssh-config-work = userSecret ./secrets/shared/ssh-config-work.age; @@ -162,10 +168,12 @@ }; }; }; workModules = [ + description = "jolheiser's nixos config"; { - url = "github:ryantm/agenix"; + inputs.nixpkgs.follows = "nixpkgs"; agenix = { - + description = "jolheiser's nixos config"; + (commonConfig {}) ({pkgs, ...}: { config = { nixpkgs.overlays = [ @@ -173,6 +181,10 @@ (_: _: { py39 = import nixpkgs-py39 {inherit (pkgs) system;}; }) ]; + home-manager.users.${username}.programs = { + git.package = pkgs.gitSVN; + firefox.profiles.default.bookmarks = [(import ./apps/gui/firefox/work.nix)]; + }; age.secrets = { netrc = { file = ./secrets/work/netrc.age; @@ -198,41 +210,6 @@ username = "jolheiser"; in { { - gomodinit = { - commonModules = [ - { - home = { - inherit username; - homeDirectory = "/home/${username}"; - }; - } - ./apps/gui - ]; - in { - "jolheiser" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = commonModules; - }; - "work" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = - commonModules - ++ [ - { - nixpkgs.overlays = [ - (_: _: { - py39 = import nixpkgs-py39 {inherit (pkgs) system;}; - }) - ]; - programs = { - git.package = pkgs.gitSVN; - firefox.profiles.default.bookmarks = [(import ./apps/gui/firefox/work.nix)]; - }; - } - ]; - }; - }; -{ nur = import inputs.nur { "chai" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -262,26 +239,29 @@ }; "matcha" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ + home-manager.nixosModules.home-manager agenix.nixosModules.default ./machines/matcha - commonConfig + (commonConfig {}) ]; }; "genmaicha" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ + home-manager.nixosModules.home-manager nixos-hardware.nixosModules.framework-13-7040-amd agenix.nixosModules.default ./machines/genmaicha - commonConfig + (commonConfig {}) ]; }; "sencha" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ + home-manager.nixosModules.home-manager agenix.nixosModules.default ./machines/sencha - commonConfig + (commonConfig {}) ]; }; }; diff --git a/justfile b/justfile index 1638805a0c9e2b8f3fc235f898a6a3fb99203f3d..0cfb0855951c9e4507091c294bf017497c8ecf3b 100644 --- a/justfile +++ b/justfile @@ -12,13 +12,6 @@ switch *args: @just rebuild switch {{args}} [private] -[private] - @home-manager switch --flake . - -work: - @home-manager switch --flake '.#work' - -[private] rebuild *args: boot *args: @just rebuild boot {{args}} diff --git a/machines/earlgrey/hardware.nix b/machines/earlgrey/hardware.nix index 956ce789db191da3100a3258600b3c4e6630c7ef..aac7688fdbbfc1dda2869cfac580272f6bb01135 100644 --- a/machines/earlgrey/hardware.nix +++ b/machines/earlgrey/hardware.nix @@ -1,47 +1,45 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ - config, - lib, +{ config, lib, pkgs, modulesPath, ... }: - modulesPath, + - ... +{ +# to /etc/nixos/configuration.nix instead. }: { -# Do not modify this file! It was generated by ‘nixos-generate-config’ +{ -# Do not modify this file! It was generated by ‘nixos-generate-config’ +{ # Do not modify this file! It was generated by ‘nixos-generate-config’ # Do not modify this file! It was generated by ‘nixos-generate-config’ +{ +{ # and may be overwritten by future invocations. Please make changes -# Do not modify this file! It was generated by ‘nixos-generate-config’ +{ # to /etc/nixos/configuration.nix instead. -# Do not modify this file! It was generated by ‘nixos-generate-config’ +{ { -# Do not modify this file! It was generated by ‘nixos-generate-config’ +{ config, # Do not modify this file! It was generated by ‘nixos-generate-config’ +{ +{ lib, -# Do not modify this file! It was generated by ‘nixos-generate-config’ +{ modulesPath, -# Do not modify this file! It was generated by ‘nixos-generate-config’ +{ ... -# Do not modify this file! It was generated by ‘nixos-generate-config’ { -# Do not modify this file! It was generated by ‘nixos-generate-config’ }: { - device = "/dev/disk/by-uuid/e2274508-9989-4f6b-9bcf-a0d246f292f9"; - fsType = "ext4"; - }; boot.initrd.luks.devices."luks-1121cd25-7c4c-47ee-b04a-2cab0cd251ea".device = "/dev/disk/by-uuid/1121cd25-7c4c-47ee-b04a-2cab0cd251ea"; - fileSystems."/boot" = { + fileSystems."/boot" = -# and may be overwritten by future invocations. Please make changes config, +# Do not modify this file! It was generated by ‘nixos-generate-config’ + config, # and may be overwritten by future invocations. Please make changes - lib, - }; + }; - swapDevices = []; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's