2024-01-05 18:42:21 +01:00
|
|
|
{
|
2024-01-06 18:40:20 +01:00
|
|
|
description = "Geoffrey Frogeye's base configurations";
|
2024-01-05 18:42:21 +01:00
|
|
|
|
|
|
|
inputs = {
|
2024-05-06 22:26:36 +02:00
|
|
|
# Packages
|
2024-11-30 20:06:14 +01:00
|
|
|
nixpkgs.url = "nixpkgs/nixos-24.11";
|
|
|
|
onixpkgs.url = "nixpkgs/64b80bfb316b57cdb8919a9110ef63393d74382a";
|
2024-08-25 10:43:05 +02:00
|
|
|
unixpkgs.url = "nixpkgs/master";
|
2024-11-30 20:06:14 +01:00
|
|
|
labellenixpkgs.url = "github:FabianRig/nixpkgs/update-labelle-1.3.2"; # Current 24.11 version doesn't match dependencies
|
2024-01-06 18:40:20 +01:00
|
|
|
# OS
|
|
|
|
disko = {
|
|
|
|
url = "disko";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
nixos-hardware.url = "nixos-hardware";
|
2024-01-16 22:39:29 +01:00
|
|
|
# NOD
|
|
|
|
nix-on-droid = {
|
2024-11-30 20:06:14 +01:00
|
|
|
url = "github:nix-community/nix-on-droid"; # No 24.11 yet
|
2024-01-16 22:39:29 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2024-01-16 23:27:15 +01:00
|
|
|
inputs.home-manager.follows = "home-manager";
|
2024-01-16 22:39:29 +01:00
|
|
|
};
|
2024-01-06 18:40:20 +01:00
|
|
|
# HM
|
|
|
|
home-manager = {
|
2024-11-30 20:06:14 +01:00
|
|
|
url = "home-manager/release-24.11";
|
2024-01-06 18:40:20 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
stylix = {
|
2024-12-14 21:24:20 +01:00
|
|
|
url = "github:danth/stylix/release-24.11";
|
2024-01-06 18:40:20 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
nixvim = {
|
2024-11-30 20:06:14 +01:00
|
|
|
url = "github:nix-community/nixvim/nixos-24.11";
|
2024-01-06 18:40:20 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-01-15 23:11:21 +01:00
|
|
|
nur.url = "github:nix-community/NUR";
|
2024-05-08 09:37:04 +02:00
|
|
|
# Local
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2024-01-05 18:42:21 +01:00
|
|
|
};
|
|
|
|
|
2024-06-01 18:22:50 +02:00
|
|
|
outputs = { self, nixpkgs, disko, nix-on-droid, flake-utils, ... }@attrs:
|
2024-05-08 09:37:04 +02:00
|
|
|
# Machine independant outputs
|
2024-01-06 18:40:20 +01:00
|
|
|
let
|
2024-01-16 23:48:41 +01:00
|
|
|
nixpkgsConfig = {
|
2024-03-21 23:23:22 +01:00
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
2024-06-17 18:21:09 +02:00
|
|
|
overlays = [
|
|
|
|
(import ./common/update-local-flakes/overlay.nix)
|
|
|
|
];
|
2024-03-26 17:04:16 +01:00
|
|
|
};
|
|
|
|
homeManagerConfig = {
|
|
|
|
sharedModules = [ self.homeManagerModules.dotfiles ];
|
|
|
|
extraSpecialArgs = attrs;
|
2024-01-16 23:48:41 +01:00
|
|
|
};
|
2024-01-06 18:40:20 +01:00
|
|
|
lib = {
|
2024-01-16 22:39:29 +01:00
|
|
|
nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem {
|
2024-01-06 18:40:20 +01:00
|
|
|
inherit system;
|
2024-03-26 16:18:17 +01:00
|
|
|
specialArgs = attrs;
|
2024-01-06 18:40:20 +01:00
|
|
|
modules = modules ++ [
|
|
|
|
self.nixosModules.dotfiles
|
|
|
|
{
|
2024-01-16 23:48:41 +01:00
|
|
|
nixpkgs = nixpkgsConfig;
|
2024-03-26 17:04:16 +01:00
|
|
|
home-manager = homeManagerConfig;
|
2024-06-23 23:57:03 +02:00
|
|
|
frogeye.toplevel = { _type = "override"; content = self; priority = 1000; };
|
2024-01-06 18:40:20 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-01-16 22:39:29 +01:00
|
|
|
nixOnDroidConfiguration = { modules ? [ ] }: nix-on-droid.lib.nixOnDroidConfiguration {
|
2024-01-16 23:48:41 +01:00
|
|
|
pkgs = import nixpkgs (nixpkgsConfig // {
|
|
|
|
system = "aarch64-linux"; # nod doesn't support anything else
|
|
|
|
});
|
2024-01-16 22:39:29 +01:00
|
|
|
modules = modules ++ [
|
|
|
|
self.nixOnDroidModules.dotfiles
|
|
|
|
{
|
2024-03-26 17:04:16 +01:00
|
|
|
home-manager = homeManagerConfig;
|
2024-01-16 22:39:29 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-05-08 09:47:57 +02:00
|
|
|
flakeTools = { self }: flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
2024-12-03 22:42:01 +01:00
|
|
|
pkgs = import nixpkgs
|
|
|
|
(nixpkgsConfig // {
|
|
|
|
inherit system;
|
|
|
|
# We do an overlay here so nixos-rebuild and other use lix.
|
|
|
|
# We don't do an overlay for the whole system because lix is not binary compatible.
|
|
|
|
overlays = [
|
|
|
|
(self: super: { nix = super.lix; })
|
|
|
|
];
|
|
|
|
});
|
2024-05-08 09:47:57 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
apps = {
|
|
|
|
disko = {
|
|
|
|
type = "app";
|
|
|
|
program = "${disko.packages.${system}.default}/bin/disko";
|
|
|
|
};
|
|
|
|
nixos-install = {
|
|
|
|
type = "app";
|
|
|
|
program = "${pkgs.nixos-install-tools}/bin/nixos-install";
|
|
|
|
};
|
|
|
|
nixos-rebuild = {
|
|
|
|
type = "app";
|
|
|
|
program = "${pkgs.nixos-rebuild}/bin/nixos-rebuild";
|
|
|
|
};
|
|
|
|
repl = {
|
|
|
|
type = "app";
|
|
|
|
program = "${pkgs.writeShellScript "vivarium-repl" ''
|
2024-06-08 15:54:33 +02:00
|
|
|
${pkgs.lix}/bin/nix repl --expr 'let flake = builtins.getFlake "${self}"; in flake // flake.nixosConfigurations // rec { pkgs = import ${nixpkgs} {}; lib = pkgs.lib; }'
|
|
|
|
''}";
|
2024-05-08 09:47:57 +02:00
|
|
|
};
|
2024-06-17 18:21:09 +02:00
|
|
|
# Available globally should this be needed in times of shenanigans
|
2024-06-10 02:11:04 +02:00
|
|
|
updateLocalFlakes = {
|
|
|
|
type = "app";
|
2024-06-17 18:21:09 +02:00
|
|
|
program = "${pkgs.update-local-flakes}/bin/update-local-flakes";
|
2024-06-10 02:11:04 +02:00
|
|
|
};
|
|
|
|
nixosRebuild = {
|
|
|
|
type = "app";
|
|
|
|
program = "${pkgs.writeShellScript "rebuild" ''${pkgs.writeShellApplication {
|
|
|
|
name = "rebuild";
|
|
|
|
runtimeInputs = with pkgs; [ nix-output-monitor nixos-rebuild ];
|
|
|
|
text = builtins.readFile ./os/rebuild.sh;
|
|
|
|
}}/bin/rebuild ${self} "$@"''}";
|
|
|
|
};
|
2024-05-08 09:47:57 +02:00
|
|
|
};
|
2024-12-15 00:04:26 +01:00
|
|
|
formatter = pkgs.nixfmt-rfc-style;
|
2024-05-08 09:47:57 +02:00
|
|
|
}
|
|
|
|
);
|
2024-01-06 18:40:20 +01:00
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2024-02-17 23:35:53 +01:00
|
|
|
# Reusable configurations
|
2024-05-08 09:37:04 +02:00
|
|
|
inherit lib;
|
|
|
|
nixosModules.dotfiles.imports = [ ./os ];
|
|
|
|
nixOnDroidModules.dotfiles.imports = [ ./nod ];
|
|
|
|
homeManagerModules.dotfiles.imports = [ ./hm ];
|
2024-02-17 23:35:53 +01:00
|
|
|
# Actual configurations
|
2024-01-06 18:40:20 +01:00
|
|
|
nixosConfigurations.curacao = lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
2024-05-08 09:37:04 +02:00
|
|
|
modules = [ ./curacao ];
|
2024-02-17 18:39:09 +01:00
|
|
|
};
|
2024-02-17 23:35:53 +01:00
|
|
|
nixosConfigurations.curacao-usb = lib.nixosSystem {
|
2024-02-17 18:39:09 +01:00
|
|
|
system = "x86_64-linux";
|
2024-05-08 09:37:04 +02:00
|
|
|
modules = [ ./curacao/usb.nix ];
|
2024-01-06 18:40:20 +01:00
|
|
|
};
|
|
|
|
nixosConfigurations.pindakaas = lib.nixosSystem {
|
|
|
|
system = "aarch64-linux";
|
2024-05-08 09:37:04 +02:00
|
|
|
modules = [ ./pindakaas ];
|
2024-02-17 18:39:09 +01:00
|
|
|
};
|
|
|
|
nixosConfigurations.pindakaas-sd = lib.nixosSystem {
|
|
|
|
system = "aarch64-linux";
|
2024-05-08 09:37:04 +02:00
|
|
|
modules = [ ./pindakaas/sd.nix ];
|
2024-01-06 18:40:20 +01:00
|
|
|
};
|
2024-06-12 23:47:00 +02:00
|
|
|
nixosConfigurations.cranberry = lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [ ./cranberry ];
|
|
|
|
};
|
2024-01-16 22:39:29 +01:00
|
|
|
nixOnDroidConfigurations.sprinkles = lib.nixOnDroidConfiguration { };
|
2024-06-23 23:57:03 +02:00
|
|
|
# Fake systems
|
|
|
|
nixosConfigurations.abavorana = lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [ ./abavorana/standin.nix ];
|
|
|
|
};
|
|
|
|
nixosConfigurations.sprinkles = lib.nixosSystem {
|
|
|
|
system = "aarch64-linux";
|
|
|
|
modules = [ ./sprinkles/standin.nix ];
|
|
|
|
};
|
|
|
|
# TODO devices/ or configs/ folders
|
2024-05-08 09:47:57 +02:00
|
|
|
} // (lib.flakeTools { inherit self; });
|
2024-06-08 15:54:33 +02:00
|
|
|
}
|