nixos-configs/lib/flake/default.nix

117 lines
3 KiB
Nix
Raw Normal View History

inputs: rec {
# Import pkgs from a nixpkgs instance
mkPkgs = {
system,
nixpkgs,
cfg ? {},
2024-12-10 22:28:26 -05:00
nix ? null,
cudaSupport ? false,
}:
import nixpkgs {
inherit system;
2024-12-10 22:28:26 -05:00
overlays =
[
(inputs.self.overlays.nix-version {inherit nix;})
inputs.self.overlays.build-failures
]
++ (cfg.overlays or []);
config =
{
inherit cudaSupport;
allowUnfree = true;
2024-12-22 03:12:45 -05:00
chore: update sources Flake Inputs: • Updated input 'astal': 'github:Aylur/astal' (2025-01-12) rev: 6fd7ae514af36ff9baf1209a2eeebd3a26cf94ce → 'github:Aylur/astal' (2025-01-13) rev: cac0fc63bfe098b26753db8262f5d95ac42b281b • Updated input 'custom-sidebar-src': 'github:elchininet/custom-sidebar' (2025-01-12) rev: dd69b17b383e6135a8198248292786b7839aef85 → 'github:elchininet/custom-sidebar' (2025-01-14) rev: 2861df235213e2cdbabddd41ecdf41b57ab5f33c • Updated input 'gpu-screen-recorder-src': 'git+https://repo.dec05eba.com/gpu-screen-recorder' (2025-01-10) rev: 3a200a4c9f74c93c7fa97d013613db60a3290538 → 'git+https://repo.dec05eba.com/gpu-screen-recorder' (2025-01-13) rev: 4211dfa2f8649d724f4d08f382dba7ffc7af59f9 • Updated input 'home-manager': 'github:nix-community/home-manager' (2025-01-10) rev: 2532b500c3ed2b8940e831039dcec5a5ea093afc → 'github:nix-community/home-manager' (2025-01-13) rev: fc52a210b60f2f52c74eac41a8647c1573d2071d • Updated input 'hyprgrass': 'github:horriblename/hyprgrass' (2025-01-09) rev: dcf43737772490f9dc755983f5c8ddda5f83ec5b → 'github:horriblename/hyprgrass' (2025-01-13) rev: d324904d70e8c9710bcf772227f364262baf3820 • Updated input 'nh': 'github:viperML/nh' (2025-01-02) rev: b7a857066e726dafe9c5f00a8af6ab3f25036ee1 → 'github:viperML/nh' (2025-01-13) rev: f4da5cf5af09e01a0177e889aa6fc682c6176a67 • Updated input 'nix-gaming': 'github:fufexan/nix-gaming' (2025-01-12) rev: f0bba32370e38a6ed18d7c5c741d23fe53e2d265 → 'github:fufexan/nix-gaming' (2025-01-14) rev: 1a9c52cd7517137c9cc74d4b73dfd63678e17c5f • Updated input 'nixpkgs': 'github:NixOS/nixpkgs' (2025-01-10) rev: 130595eba61081acde9001f43de3248d8888ac4a → 'github:NixOS/nixpkgs' (2025-01-12) rev: ed4a395ea001367c1f13d34b1e01aa10290f67d6 • Updated input 'nixpkgs-wayland': 'github:nix-community/nixpkgs-wayland' (2025-01-12) rev: 2cb439411d17eb145a99536196f5ab11685268b8 → 'github:nix-community/nixpkgs-wayland' (2025-01-13) rev: 6dd8c0145109a9b9aff360eb6c4319ba65a890cf • Updated input 'sops-nix': 'github:Mic92/sops-nix' (2025-01-10) rev: f214c1b76c347a4e9c8fb68c73d4293a6820d125 → 'github:Mic92/sops-nix' (2025-01-13) rev: 553c7cb22fed19fd60eb310423fdc93045c51ba8 • Updated input 'spotifywebapi-src': 'github:thlucas1/SpotifyWebApiPython' (2025-01-11) rev: 0f7dc906b5a0c7e4e960ff0a87a51d050aec45b7 → 'github:thlucas1/SpotifyWebApiPython' (2025-01-14) rev: a6deed7acda1c4df0009fb1aacfdc1c4dd203ac1 • Updated input 'tuya-local-src': 'github:make-all/tuya-local' (2025-01-12) rev: 627e07e5627da27ccc474bfe9cdb61f3126e0adb → 'github:make-all/tuya-local' (2025-01-13) rev: 85f3c17a9b4a0fd4f799c7223d7b87496dcd0b4f Docker Images: • nginx latest: sha256:42e917aaa1b5bb40dd0f6f7f4f857490ac7747d7ef73b391c774a41a8b994f15 → sha256:2300fb715ab3a2595a3e6956db7379d25b2815973416e6261dde607ca3a86370 Node modules: @stylistic/eslint-plugin: 2.12.1 -> 2.13.0 typescript-eslint: 8.19.1 -> 8.20.0 @types/node: 22.10.5 -> 22.10.6
2025-01-14 01:19:09 -05:00
# FIXME: Roslyn-ls uses dotnet6 https://pr-tracker.nelim.org/?pr=373293
2024-12-22 03:12:45 -05:00
permittedInsecurePackages =
[
"dotnet-core-combined"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
]
++ (cfg.config.permittedInsecurePackages or []);
}
// (builtins.removeAttrs (
if cfg.config or null == null
then {}
else cfg.config
) ["permittedInsecurePackages"]);
};
2024-09-25 15:34:56 -04:00
# Enable use of `nixpkgs.overlays` on both NixOS and NixOnDroid
2024-09-22 23:16:10 -04:00
allowModularOverrides = {
cudaSupport ? false,
system,
2024-09-22 23:16:10 -04:00
}: ({config, ...}: let
pkgs = mkPkgs {
cfg = config.nixpkgs;
2024-12-10 22:28:26 -05:00
nix = config.nix.package;
2024-09-22 23:16:10 -04:00
inherit system cudaSupport;
inherit (inputs) nixpkgs;
};
inherit (pkgs.lib) mkForce;
2024-09-22 23:16:10 -04:00
in {
_module.args.pkgs = mkForce pkgs;
2024-09-22 23:16:10 -04:00
});
# Default system
mkNixOS = {
extraModules ? [],
cudaSupport ? false,
mainUser ? "matt",
}:
inputs.nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = inputs // {inherit mainUser;};
modules =
[
2024-09-22 23:16:10 -04:00
(allowModularOverrides {inherit system cudaSupport;})
inputs.home-manager.nixosModules.home-manager
{home-manager.extraSpecialArgs = specialArgs;}
]
++ extraModules;
};
mkNixOnDroid = extraModules: let
system = "aarch64-linux";
in
inputs.nix-on-droid.lib.nixOnDroidConfiguration rec {
2024-09-22 23:16:10 -04:00
extraSpecialArgs = inputs;
home-manager-path = inputs.home-manager.outPath;
pkgs = mkPkgs {
inherit system;
inherit (inputs) nixpkgs;
};
2024-09-22 23:16:10 -04:00
modules =
[
(allowModularOverrides {inherit system;})
2024-09-22 23:16:10 -04:00
({
config,
lib,
...
}: let
inherit (lib) mkForce mkOption types;
2024-09-22 23:16:10 -04:00
in {
# Adapt NixOnDroid to NixOS options
options.environment = {
variables.FLAKE = mkOption {
type = with types; nullOr str;
};
2024-09-22 23:16:10 -04:00
systemPackages = mkOption {
type = with types; listOf package;
default = [];
};
};
2024-09-22 23:16:10 -04:00
config.environment.packages = config.environment.systemPackages;
2024-09-25 15:34:56 -04:00
# This disables the assertion that fails because of nixpkgs.overlays
config._module.args.isFlake = mkForce false;
})
2024-09-22 23:16:10 -04:00
{home-manager = {inherit extraSpecialArgs;};}
]
++ extraModules;
};
}