fix: share pkgs & overlays with home-manager
This commit is contained in:
parent
a04fca65d8
commit
f25ca7a488
11 changed files with 74 additions and 63 deletions
14
flake.nix
14
flake.nix
|
@ -75,12 +75,7 @@ rec {
|
|||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
...
|
||||
}@inputs:
|
||||
inputs:
|
||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
|
@ -91,7 +86,7 @@ rec {
|
|||
./lib/flake-module.nix
|
||||
./hosts/flake-module.nix
|
||||
./home/flake-module.nix
|
||||
./overlays.nix
|
||||
./overlays/flake-module.nix
|
||||
];
|
||||
flake = {
|
||||
inherit nixConfig;
|
||||
|
@ -110,11 +105,6 @@ rec {
|
|||
...
|
||||
}:
|
||||
{
|
||||
_module.args.pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell { inherit (config.checks.pre-commit) shellHook; };
|
||||
|
||||
checks = {
|
||||
|
|
|
@ -38,11 +38,5 @@
|
|||
|
||||
programs.git.defaultProfile = "private";
|
||||
|
||||
xdg.configFile."nixpkgs/config.nix".text = ''
|
||||
{
|
||||
allowUnfree = true;
|
||||
}
|
||||
'';
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
}
|
||||
|
|
|
@ -40,12 +40,6 @@ with pkgs;
|
|||
defaultProfile = "work";
|
||||
};
|
||||
|
||||
xdg.configFile."nixpkgs/config.nix".text = ''
|
||||
{
|
||||
allowUnfree = true;
|
||||
}
|
||||
'';
|
||||
|
||||
home.packages = with pkgs; [
|
||||
fh
|
||||
|
||||
|
|
|
@ -38,12 +38,6 @@
|
|||
|
||||
programs.git.defaultProfile = "private";
|
||||
|
||||
xdg.configFile."nixpkgs/config.nix".text = ''
|
||||
{
|
||||
allowUnfree = true;
|
||||
}
|
||||
'';
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# system
|
||||
gparted
|
||||
|
|
|
@ -1,26 +1,38 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
createHomeConfig =
|
||||
name: args:
|
||||
inputs.home-manager.lib.homeManagerConfiguration (
|
||||
{
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
}
|
||||
// args
|
||||
);
|
||||
mkHomeConfiguration =
|
||||
{
|
||||
user,
|
||||
system,
|
||||
modules,
|
||||
}:
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = self.pkgsFor system;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
|
||||
modules =
|
||||
(with self.homeModules; [ nixpkgs ])
|
||||
++ [
|
||||
{
|
||||
home.username = user;
|
||||
home.homeDirectory = "/home/${user}";
|
||||
}
|
||||
]
|
||||
++ modules;
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ inputs.home-manager.flakeModules.home-manager ];
|
||||
|
||||
flake = {
|
||||
homeModules = {
|
||||
nixpkgs = import ./modules/nixpkgs.nix;
|
||||
git = import ./modules/git.nix;
|
||||
firefox = import ./modules/firefox/firefox.nix;
|
||||
tor-browser = import ./modules/firefox/tor-browser.nix;
|
||||
|
@ -32,26 +44,31 @@ in
|
|||
felschr-work = import ./felschr-work.nix;
|
||||
};
|
||||
homeConfigurations = {
|
||||
felschr = createHomeConfig {
|
||||
felschr = mkHomeConfiguration {
|
||||
user = "felschr";
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
self.homeModules.git
|
||||
self.homeModules.felschr
|
||||
];
|
||||
};
|
||||
felschr-server = createHomeConfig {
|
||||
felschr-server = mkHomeConfiguration {
|
||||
user = "felschr";
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
self.homeModules.git
|
||||
self.homeModules.felschr-server
|
||||
];
|
||||
};
|
||||
felschr-work = createHomeConfig {
|
||||
felschr-work = mkHomeConfiguration {
|
||||
user = "felschr";
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
self.homeModules.git
|
||||
self.homeModules.felschr-work
|
||||
];
|
||||
};
|
||||
};
|
||||
# HINT alias for deprecated output
|
||||
homeManagerModules = self.homeModules;
|
||||
homeManagerModules = lib.warn "`homeManagerModules` is deprecated. Use `homeModules` instead." self.homeModules;
|
||||
};
|
||||
}
|
||||
|
|
11
home/modules/nixpkgs.nix
Normal file
11
home/modules/nixpkgs.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
_:
|
||||
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
xdg.configFile."nixpkgs/config.nix".text = ''
|
||||
{
|
||||
allowUnfree = true;
|
||||
}
|
||||
'';
|
||||
}
|
|
@ -22,8 +22,6 @@
|
|||
../../services/open-webui.nix
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
boot.loader.systemd-boot.memtest86.enable = true;
|
||||
|
||||
# running binaries for other architectures
|
||||
|
|
|
@ -50,8 +50,6 @@ in
|
|||
age.secrets.cloudflare.file = ../../secrets/cloudflare.age;
|
||||
age.secrets.hostKey.file = ../../secrets/home-server/hostKey.age;
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
networking.domain = "home.felschr.com";
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
|
|
14
overlays.nix
14
overlays.nix
|
@ -1,14 +0,0 @@
|
|||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
flake = {
|
||||
overlays.default = final: prev: {
|
||||
unstable = import inputs.nixpkgs-unstable {
|
||||
inherit (prev) system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
inherit (inputs.self.packages.${prev.system}) deconz brlaser;
|
||||
vimPlugins = prev.vimPlugins // final.callPackage ./pkgs/vim-plugins { inherit inputs; };
|
||||
};
|
||||
};
|
||||
}
|
27
overlays/flake-module.nix
Normal file
27
overlays/flake-module.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ self, inputs, ... }:
|
||||
|
||||
{
|
||||
flake = {
|
||||
overlays.default = final: prev: {
|
||||
unstable = import inputs.nixpkgs-unstable {
|
||||
inherit (prev) system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
inherit (inputs.self.packages.${prev.system}) deconz brlaser;
|
||||
vimPlugins = prev.vimPlugins // final.callPackage ../pkgs/vim-plugins { inherit inputs; };
|
||||
};
|
||||
pkgsFor =
|
||||
system:
|
||||
import inputs.nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default ];
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
perSystem =
|
||||
{ system, ... }:
|
||||
{
|
||||
_module.args.pkgs = self.pkgsFor system;
|
||||
};
|
||||
}
|
|
@ -4,6 +4,8 @@ let
|
|||
inherit (inputs.self.outputs) nixConfig;
|
||||
in
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "04:00";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue