mirror of
https://github.com/Misterio77/Foundry.git
synced 2026-09-24 23:30:40 -05:00
use hm as nixos (in addition to standalone)
Surprisingly, home-manager works fine as a nixos module, and you can even run `home-manager switch` subsequently and it'll work! This commit also removes legacyPackages from exported, and setups `nixpkgs` options instead of passing a pre-configure instance.
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, ... }@inputs:
|
||||
let
|
||||
inherit (nixpkgs.lib) filterAttrs traceVal;
|
||||
inherit (nixpkgs.lib) filterAttrs;
|
||||
inherit (builtins) mapAttrs elem;
|
||||
inherit (self) outputs;
|
||||
notBroken = x: !(x.meta.broken or false);
|
||||
@@ -52,19 +52,11 @@
|
||||
homeManagerModules = import ./modules/home-manager;
|
||||
overlays = import ./overlays;
|
||||
|
||||
legacyPackages = forAllSystems (system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
overlays = with overlays; [ additions wallpapers modifications ];
|
||||
config.allowUnfree = true;
|
||||
}
|
||||
);
|
||||
|
||||
packages = forAllSystems (system:
|
||||
import ./pkgs { pkgs = legacyPackages.${system}; }
|
||||
nixpkgs.legacyPackages.${system}.callPackage ./pkgs { }
|
||||
);
|
||||
devShells = forAllSystems (system: {
|
||||
default = import ./shell.nix { pkgs = legacyPackages.${system}; };
|
||||
default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
|
||||
});
|
||||
|
||||
hydraJobs = {
|
||||
@@ -76,31 +68,26 @@
|
||||
nixosConfigurations = rec {
|
||||
# Desktop
|
||||
atlas = nixpkgs.lib.nixosSystem {
|
||||
pkgs = legacyPackages."x86_64-linux";
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./hosts/atlas ];
|
||||
};
|
||||
# Laptop
|
||||
pleione = nixpkgs.lib.nixosSystem {
|
||||
pkgs = legacyPackages."x86_64-linux";
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./hosts/pleione ];
|
||||
};
|
||||
# Secondary Desktop
|
||||
maia = nixpkgs.lib.nixosSystem {
|
||||
pkgs = legacyPackages."x86_64-linux";
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./hosts/maia ];
|
||||
};
|
||||
# Raspberry Pi 4
|
||||
merope = nixpkgs.lib.nixosSystem {
|
||||
pkgs = legacyPackages."aarch64-linux";
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./hosts/merope ];
|
||||
};
|
||||
# VPS
|
||||
electra = nixpkgs.lib.nixosSystem {
|
||||
pkgs = legacyPackages."x86_64-linux";
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./hosts/electra ];
|
||||
};
|
||||
@@ -109,37 +96,37 @@
|
||||
homeConfigurations = {
|
||||
# Desktop
|
||||
"misterio@atlas" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = legacyPackages."x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||
extraSpecialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./home/misterio/atlas.nix ];
|
||||
};
|
||||
# Laptop
|
||||
"misterio@pleione" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = legacyPackages."x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||
extraSpecialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./home/misterio/pleione.nix ];
|
||||
};
|
||||
# Secondary Desktop
|
||||
"misterio@maia" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = legacyPackages."x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||
extraSpecialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./home/misterio/maia.nix ];
|
||||
};
|
||||
# Raspi 4
|
||||
"misterio@merope" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = legacyPackages."aarch64-linux";
|
||||
pkgs = nixpkgs.legacyPackages."aarch64-linux";
|
||||
extraSpecialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./home/misterio/merope.nix ];
|
||||
};
|
||||
# VPS
|
||||
"misterio@electra" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = legacyPackages."x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||
extraSpecialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./home/misterio/electra.nix ];
|
||||
};
|
||||
# Portable minimum configuration
|
||||
"misterio@generic" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = legacyPackages."x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||
extraSpecialArgs = { inherit inputs outputs; };
|
||||
modules = [ ./home/misterio/generic.nix ];
|
||||
};
|
||||
|
||||
@@ -11,15 +11,21 @@ in
|
||||
../features/nvim
|
||||
] ++ (builtins.attrValues outputs.homeManagerModules);
|
||||
|
||||
colorscheme = lib.mkDefault colorSchemes.dracula;
|
||||
wallpaper = lib.mkDefault (nixWallpaperFromScheme {
|
||||
scheme = config.colorscheme;
|
||||
width = 2560;
|
||||
height = 1080;
|
||||
logoScale = 4.5;
|
||||
});
|
||||
nixpkgs = {
|
||||
overlays = builtins.attrValues outputs.overlays;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
allowUnfreePredicate = (_: true);
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".colorscheme".text = config.colorscheme.slug;
|
||||
nix = {
|
||||
package = lib.mkDefault pkgs.nix;
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.startServices = "sd-switch";
|
||||
|
||||
@@ -28,14 +34,6 @@ in
|
||||
git.enable = true;
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = pkgs.nix;
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
username = lib.mkDefault "misterio";
|
||||
homeDirectory = lib.mkDefault "/home/${config.home.username}";
|
||||
@@ -53,4 +51,13 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
colorscheme = lib.mkDefault colorSchemes.dracula;
|
||||
wallpaper = lib.mkDefault (nixWallpaperFromScheme {
|
||||
scheme = config.colorscheme;
|
||||
width = 2560;
|
||||
height = 1080;
|
||||
logoScale = 4.5;
|
||||
});
|
||||
home.file.".colorscheme".text = config.colorscheme.slug;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
{
|
||||
imports = [
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
./acme.nix
|
||||
./fish.nix
|
||||
./locale.nix
|
||||
@@ -15,27 +16,28 @@
|
||||
./ssh-serve-store.nix
|
||||
] ++ (builtins.attrValues outputs.nixosModules);
|
||||
|
||||
networking.domain = "m7.rs";
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = { inherit inputs outputs; };
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
overlays = builtins.attrValues outputs.overlays;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
loginShellInit = ''
|
||||
# Activate home-manager environment, if not already
|
||||
[ -d "$HOME/.nix-profile" ] || /nix/var/nix/profiles/per-user/$USER/home-manager/activate &> /dev/null
|
||||
'';
|
||||
|
||||
# Persist logs, timers, etc
|
||||
persistence = {
|
||||
"/persist".directories = [ "/var/lib/systemd" "/var/log" "/srv" ];
|
||||
};
|
||||
|
||||
# Add terminfo files
|
||||
enableAllTerminfo = true;
|
||||
};
|
||||
|
||||
# Allows users to allow others on their binds
|
||||
programs.fuse.userAllowOther = true;
|
||||
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
networking.domain = "m7.rs";
|
||||
|
||||
# Increase open file limit for sudoers
|
||||
security.pam.loginLimits = [
|
||||
|
||||
@@ -26,6 +26,7 @@ in
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDci4wJghnRRSqQuX1z2xeaUR+p/muKzac0jw0mgpXE2T/3iVlMJJ3UXJ+tIbySP6ezt0GVmzejNOvUarPAm0tOcW6W0Ejys2Tj+HBRU19rcnUtf4vsKk8r5PW5MnwS8DqZonP5eEbhW2OrX5ZsVyDT+Bqrf39p3kOyWYLXT2wA7y928g8FcXOZjwjTaWGWtA+BxAvbJgXhU9cl/y45kF69rfmc3uOQmeXpKNyOlTk6ipSrOfJkcHgNFFeLnxhJ7rYxpoXnxbObGhaNqn7gc5mt+ek+fwFzZ8j6QSKFsPr0NzwTFG80IbyiyrnC/MeRNh7SQFPAESIEP8LK3PoNx2l1M+MjCQXsb4oIG2oYYMRa2yx8qZ3npUOzMYOkJFY1uI/UEE/j/PlQSzMHfpmWus4o2sijfr8OmVPGeoU/UnVPyINqHhyAd1d3Iji3y3LMVemHtp5wVcuswABC7IRVVKZYrMCXMiycY5n00ch6XTaXBwCY00y8B3Mzkd7Ofq98YHc= (none)"
|
||||
];
|
||||
passwordFile = config.sops.secrets.misterio-password.path;
|
||||
packages = [ pkgs.home-manager ];
|
||||
};
|
||||
|
||||
sops.secrets.misterio-password = {
|
||||
@@ -33,6 +34,7 @@ in
|
||||
neededForUsers = true;
|
||||
};
|
||||
|
||||
home-manager.users.misterio = import ../../../home/misterio/${config.networking.hostName}.nix;
|
||||
|
||||
services.geoclue2.enable = true;
|
||||
security.pam.services = { swaylock = { }; };
|
||||
|
||||
Reference in New Issue
Block a user