Geoffrey Frogeye
c4bb02b16e
Without remote builds and with my laptop setup it's not really viable for now :(
163 lines
4.7 KiB
Nix
163 lines
4.7 KiB
Nix
{
|
|
description = "Geoffrey Frogeye's base configurations";
|
|
|
|
inputs = {
|
|
# Package manager
|
|
lix = {
|
|
url = "git+https://git@git.lix.systems/lix-project/lix?ref=refs/tags/2.90-beta.1";
|
|
flake = false;
|
|
};
|
|
lix-module = {
|
|
url = "git+https://git.lix.systems/lix-project/nixos-module";
|
|
inputs = {
|
|
lix.follows = "lix";
|
|
nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
# Packages
|
|
nixpkgs.url = "nixpkgs/nixos-23.11";
|
|
unixpkgs.url = "nixpkgs";
|
|
# OS
|
|
disko = {
|
|
url = "disko";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nixos-hardware.url = "nixos-hardware";
|
|
# NOD
|
|
nix-on-droid = {
|
|
url = "github:nix-community/nix-on-droid/release-23.05"; # No 23.11 :(
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.home-manager.follows = "home-manager";
|
|
};
|
|
# HM
|
|
home-manager = {
|
|
url = "home-manager/release-23.11";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
stylix = {
|
|
url = "github:danth/stylix/release-23.11";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nixvim = {
|
|
url = "github:GeoffreyFrogeye/nixvim/frogeye-23.11";
|
|
# 24.05 Ensure merged: https://github.com/nix-community/nixvim/pull/953
|
|
# url = "github:nix-community/nixvim";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nur.url = "github:nix-community/NUR";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, unixpkgs, disko, nix-on-droid, stylix, ... }@attrs:
|
|
let
|
|
nixpkgsConfig = {
|
|
config = {
|
|
allowUnfree = true;
|
|
# TODO Not sure why, HM needs nixos-option which needs an old Nix?
|
|
permittedInsecurePackages = [
|
|
"nix-2.15.3"
|
|
];
|
|
};
|
|
overlays = [
|
|
(final: prev: { unstable = unixpkgs.legacyPackages.${prev.system}.pkgs; })
|
|
];
|
|
# Only allows importing packages, not NixOS modules. If that is needed, see:
|
|
# https://discourse.nixos.org/t/how-to-use-unstable-nixpkgs-in-imports-with-flake/17414/7
|
|
};
|
|
homeManagerConfig = {
|
|
sharedModules = [ self.homeManagerModules.dotfiles ];
|
|
extraSpecialArgs = attrs;
|
|
};
|
|
lib = {
|
|
nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
specialArgs = attrs;
|
|
modules = modules ++ [
|
|
self.nixosModules.dotfiles
|
|
{
|
|
nixpkgs = nixpkgsConfig;
|
|
home-manager = homeManagerConfig;
|
|
}
|
|
];
|
|
};
|
|
nixOnDroidConfiguration = { modules ? [ ] }: nix-on-droid.lib.nixOnDroidConfiguration {
|
|
pkgs = import nixpkgs (nixpkgsConfig // {
|
|
system = "aarch64-linux"; # nod doesn't support anything else
|
|
});
|
|
modules = modules ++ [
|
|
self.nixOnDroidModules.dotfiles
|
|
{
|
|
home-manager = homeManagerConfig;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
in
|
|
{
|
|
# Easily expose apps to scripts
|
|
apps = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: {
|
|
disko = {
|
|
type = "app";
|
|
program = "${disko.packages.${system}.default}/bin/disko";
|
|
};
|
|
nixos-generate-config = {
|
|
type = "app";
|
|
program = "${nixpkgs.legacyPackages.${system}.nixos-install-tools}/bin/nixos-generate-config";
|
|
};
|
|
nixos-install = {
|
|
type = "app";
|
|
program = "${nixpkgs.legacyPackages.${system}.nixos-install-tools}/bin/nixos-install";
|
|
};
|
|
nixos-rebuild = {
|
|
type = "app";
|
|
program = "${nixpkgs.legacyPackages.${system}.nixos-rebuild}/bin/nixos-rebuild";
|
|
};
|
|
});
|
|
# Reusable configurations
|
|
lib = lib;
|
|
nixosModules.dotfiles = {
|
|
imports = [
|
|
./os
|
|
disko.nixosModules.disko
|
|
];
|
|
};
|
|
nixOnDroidModules.dotfiles = {
|
|
imports = [
|
|
./nod
|
|
# home-manager is included
|
|
];
|
|
};
|
|
homeManagerModules.dotfiles = {
|
|
imports = [
|
|
./hm
|
|
stylix.homeManagerModules.stylix
|
|
];
|
|
};
|
|
# Actual configurations
|
|
nixosConfigurations.curacao = lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
./curacao
|
|
];
|
|
};
|
|
nixosConfigurations.curacao-usb = lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
./curacao/usb.nix
|
|
];
|
|
};
|
|
nixosConfigurations.pindakaas = lib.nixosSystem {
|
|
system = "aarch64-linux";
|
|
modules = [
|
|
./pindakaas
|
|
];
|
|
};
|
|
nixosConfigurations.pindakaas-sd = lib.nixosSystem {
|
|
system = "aarch64-linux";
|
|
modules = [
|
|
./pindakaas/sd.nix
|
|
];
|
|
};
|
|
nixOnDroidConfigurations.sprinkles = lib.nixOnDroidConfiguration { };
|
|
};
|
|
}
|