nod: Fifth attempt at flakes

Also simplified a few things, nice
This commit is contained in:
Geoffrey Frogeye 2024-01-16 23:48:41 +01:00
parent e56514890d
commit bac1813c77
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
4 changed files with 13 additions and 12 deletions

View file

@ -38,35 +38,38 @@
outputs = { self, nixpkgs, disko, nixos-hardware, nix-on-droid, home-manager, stylix, nixvim, nixgl, nur, ... }: outputs = { self, nixpkgs, disko, nixos-hardware, nix-on-droid, home-manager, stylix, nixvim, nixgl, nur, ... }:
let let
sharedOverlays = [ nixpkgsConfig = {
overlays = [
nixgl.overlay nixgl.overlay
]; ];
config.allowUnfree = true;
};
lib = { lib = {
nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem { nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = modules ++ [ modules = modules ++ [
self.nixosModules.dotfiles self.nixosModules.dotfiles
{ {
nixpkgs.overlays = sharedOverlays; nixpkgs = nixpkgsConfig;
home-manager.sharedModules = [ self.homeManagerModules.dotfiles ]; home-manager.sharedModules = [ self.homeManagerModules.dotfiles ];
} }
]; ];
}; };
nixOnDroidConfiguration = { modules ? [ ] }: nix-on-droid.lib.nixOnDroidConfiguration { nixOnDroidConfiguration = { modules ? [ ] }: nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import nixpkgs (nixpkgsConfig // {
system = "aarch64-linux"; # nod doesn't support anything else
});
modules = modules ++ [ modules = modules ++ [
self.nixOnDroidModules.dotfiles self.nixOnDroidModules.dotfiles
{ {
# TODO Can't use overlays, see
# https://github.com/nix-community/nix-on-droid/blob/039379abeee67144d4094d80bbdaf183fb2eabe5/modules/nixpkgs/options.nix#L166
home-manager.sharedModules = [ self.homeManagerModules.dotfiles ]; home-manager.sharedModules = [ self.homeManagerModules.dotfiles ];
} }
]; ];
}; };
homeManagerConfiguration = { system, modules ? [ ] }: home-manager.lib.homeManagerConfiguration { homeManagerConfiguration = { system, modules ? [ ] }: home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs { pkgs = import nixpkgs (nixpkgsConfig // {
inherit system; inherit system;
overlays = sharedOverlays; });
};
modules = modules ++ [ self.homeManagerModules.dotfiles ]; modules = modules ++ [ self.homeManagerModules.dotfiles ];
}; };
}; };
@ -83,6 +86,7 @@
nixOnDroidModules.dotfiles = { nixOnDroidModules.dotfiles = {
imports = [ imports = [
./nod ./nod
# home-manager is included
]; ];
}; };
homeManagerModules.dotfiles = { homeManagerModules.dotfiles = {

View file

@ -19,6 +19,5 @@
warn-dirty = false; warn-dirty = false;
}; };
}; };
nixpkgs.config.allowUnfree = true;
}; };
} }

View file

@ -13,7 +13,6 @@
}; };
}; };
}; };
nixpkgs.config.allowUnfree = true;
system.stateVersion = "23.11"; system.stateVersion = "23.11";
terminal.font = "${ terminal.font = "${
pkgs.nerdfonts.override { pkgs.nerdfonts.override {

View file

@ -28,7 +28,6 @@
git # Needed for all the fetchFromGit in this repo on nixos-rebuild git # Needed for all the fetchFromGit in this repo on nixos-rebuild
]; ];
nixpkgs.config.allowUnfree = true;
nix.settings = { nix.settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
warn-dirty = false; warn-dirty = false;