nod: Flake test

This commit is contained in:
Geoffrey Frogeye 2024-01-16 22:39:29 +01:00
parent 55641fe958
commit 65205a2fb8
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
9 changed files with 48 additions and 15 deletions

View file

@ -28,7 +28,6 @@ It is built on top of the Nix ecosystem
## Scripts
They all have a `-h` flag.
Except `add_channels.sh`, which should be removed as soon as I migrate to Flakes.
## Extensions

View file

@ -9,6 +9,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "nixos-hardware";
# NOD
nix-on-droid = {
url = "github:nix-community/nix-on-droid"; # No 23.11 :(
inputs.nixpkgs.follows = "nixpkgs";
};
# HM
home-manager = {
url = "home-manager/release-23.11";
@ -30,13 +35,13 @@
nur.url = "github:nix-community/NUR";
};
outputs = { self, nixpkgs, disko, nixos-hardware, home-manager, stylix, nixvim, nixgl, nur, ... }:
outputs = { self, nixpkgs, disko, nixos-hardware, nix-on-droid, home-manager, stylix, nixvim, nixgl, nur, ... }:
let
sharedOverlays = [
nixgl.overlay
];
lib = {
nixosSystem = { system, modules }: nixpkgs.lib.nixosSystem {
nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem {
inherit system;
modules = modules ++ [
self.nixosModules.dotfiles
@ -46,7 +51,16 @@
}
];
};
homeManagerConfiguration = { system, modules }: home-manager.lib.homeManagerConfiguration {
nixOnDroidConfiguration = { modules ? [ ] }: nix-on-droid.lib.nixOnDroidConfiguration {
modules = modules ++ [
self.nixOnDroidModules.dotfiles
{
nixpkgs.overlays = sharedOverlays;
home-manager.sharedModules = [ self.homeManagerModules.dotfiles ];
}
];
};
homeManagerConfiguration = { system, modules ? [ ] }: home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
overlays = sharedOverlays;
@ -64,6 +78,12 @@
home-manager.nixosModules.home-manager
];
};
nixOnDroidModules.dotfiles = {
imports = [
./nod
home-manager.nixosModules.home-manager
];
};
homeManagerModules.dotfiles = {
imports = [
./hm
@ -86,5 +106,6 @@
nixos-hardware.nixosModules.pine64-pinebook-pro
];
};
nixOnDroidConfigurations.sprinkles = lib.nixOnDroidConfiguration { };
};
}

View file

@ -31,6 +31,12 @@ in
${ulf} "$hm_flake"
home-manager "$verb" "$@"
fi
nod_flake="${config.xdg.configHome}/nix-on-droid/flake.nix"
if [ -f "$nod_flake" ]
then
${ulf} "$nod_flake"
nix-on-droid "$verb" --flake "$(dirname "$nod_flake")" "$@"
fi
'';
})
];

16
nod/README.md Normal file
View file

@ -0,0 +1,16 @@
# Flake example
`~/.config/nix-on-droid/flake.nix`
```nix
{
description = "Nix-on-droid configuration for Sprinkles";
inputs.dotfiles.url = "git+file:../dotfiles";
outputs = { dotfiles, ... }: {
nixOnDroidConfigurations.default = dotfiles.nixOnDroidConfigurations.sprinkles;
};
}
```

View file

@ -4,7 +4,7 @@
home-manager = {
useGlobalPkgs = true;
config = {...}: {
imports = [ ../../hm ];
frogeye = config.frogeye;
home.file = {
".ssh/authorized_keys" = {
# TODO Make an option and reuse at other places

View file

@ -1,6 +1,7 @@
{ ... }:
{
imports = [
../options.nix
./common
];
}

View file

@ -19,9 +19,6 @@
home-manager = {
users.geoffrey = { pkgs, ... }: {
imports = [
../hm
];
frogeye = config.frogeye;
};
# Makes VMs able to re-run

View file

@ -1 +0,0 @@
FIXME Make this work with flakes

View file

@ -1,6 +0,0 @@
{ ... }:
{
imports = [
../nod
];
}