Compare commits
2 commits
3505b4d7f0
...
737747f8f5
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 737747f8f5 | ||
Bruno BELANYI | ee6a735a2c |
33
flake.nix
33
flake.nix
|
@ -165,6 +165,39 @@
|
|||
ambroisie = prev.recurseIntoAttrs (import ./pkgs { pkgs = prev; });
|
||||
};
|
||||
};
|
||||
homeConfigurations =
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = (lib.attrValues self.overlays) ++ [
|
||||
nur.overlay
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
ambroisie = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
|
||||
modules = [
|
||||
./home
|
||||
{
|
||||
# The basics
|
||||
home.username = "ambroisie";
|
||||
home.homeDirectory = "/home/ambroisie";
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
# This is a generic linux install
|
||||
targets.genericLinux.enable = true;
|
||||
}
|
||||
];
|
||||
|
||||
extraSpecialArgs = {
|
||||
# Inject inputs to use them in global registry
|
||||
inherit inputs;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = lib.mapAttrs buildHost {
|
||||
aramis = "x86_64-linux";
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
./jq
|
||||
./mail
|
||||
./mpv
|
||||
./nix
|
||||
./nix-index
|
||||
./nm-applet
|
||||
./packages
|
||||
|
|
39
home/nix/default.nix
Normal file
39
home/nix/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Nix related settings
|
||||
{ config, inputs, lib, options, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.nix;
|
||||
in
|
||||
{
|
||||
options.my.home.nix = with lib; {
|
||||
enable = my.mkDisableOption "nix configuration";
|
||||
|
||||
addToRegistry = my.mkDisableOption "add inputs and self to registry";
|
||||
|
||||
overrideNixpkgs = my.mkDisableOption "point nixpkgs to pinned system version";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
{
|
||||
nix = {
|
||||
package = lib.mkDefault pkgs.nix;
|
||||
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
(lib.mkIf cfg.addToRegistry {
|
||||
nix.registry = {
|
||||
# Allow me to use my custom package using `nix run self#pkg`
|
||||
self.flake = inputs.self;
|
||||
# Use pinned nixpkgs when using `nix run pkgs#<whatever>`
|
||||
pkgs.flake = inputs.nixpkgs;
|
||||
# ... And also with `nix run nixpkgs#<whatever>`
|
||||
nixpkgs.flake = lib.mkIf cfg.overrideNixpkgs inputs.nixpkgs;
|
||||
# Add NUR to run some packages that are only present there
|
||||
nur.flake = inputs.nur;
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
Loading…
Reference in a new issue