refactor: flake dir -> outputs/sys -> nixos

This commit is contained in:
ooks-io 2024-06-08 23:06:08 +12:00
parent 3615bb010f
commit a6d5e892a1
73 changed files with 9 additions and 2 deletions

View file

@ -0,0 +1,49 @@
{ lib, config, pkgs, inputs, ... }:
let
inherit (lib) mkIf mapAttrs mapAttrsToList;
host = config.ooknet.host;
in
{
imports = [
./nh.nix
./nixpkgs.nix
./subs.nix
];
config = mkIf (host.type != "phone") {
environment = {
systemPackages = with pkgs; [
git
deadnix
statix
];
defaultPackages = [];
etc = {
"nix/flake-channels/nixpkgs".source = inputs.nixpkgs;
"nix/flake-channels/home-manager".source = inputs.nixpkgs;
};
};
nix = {
registry = mapAttrs (_: v: {flake = v;}) inputs;
nixPath = mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
optimise = {
automatic = true;
dates = [ "18:00" ];
};
gc = {
automatic = true;
dates = "Sun *-*-* 17:00";
options = "--delete-older-than 30d";
};
settings = {
flake-registry = "/etc/nix/registry.json";
allowed-users = [ "root" "@wheel" ];
trusted-users = [ "root" "@wheel" ];
experimental-features = [ "nix-command" "flakes" ];
builders-use-substitutes = true;
};
};
};
}

View file

@ -0,0 +1,18 @@
{ pkgs, lib, config, ... }:
let
inherit (lib) mkIf;
host = config.ooknet.host;
in
{
config = mkIf (host.type != "phone") {
# TODO: i dont't want to hardcode this.
environment.variables.FLAKE = "/home/ooks/.config/ooknet/";
programs.nh = {
enable = true;
package = pkgs.nh;
};
};
}

View file

@ -0,0 +1,25 @@
{ lib, config, inputs, ... }:
let
inherit (lib) mkIf;
host = config.ooknet.host;
in
{
config = mkIf (host.type != "phone") {
nixpkgs = {
config = {
allowUnfree = true;
permittedInsecurePackages = [
"openssl-1.1.1u"
"electron-25.9.0"
];
};
overlays = [
(final: prev: {
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
})
];
};
};
}

View file

@ -0,0 +1,33 @@
{ lib, config, ... }:
let
inherit (lib) mkIf;
host = config.ooknet.host;
in
{
config = mkIf (host.type != "phone") {
nix.settings = {
substituters = [
"https://cache.nixos.org?priority=10"
"https://fufexan.cachix.org"
"https://helix.cachix.org"
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
"https://nix-gaming.cachix.org"
"https://anyrun.cachix.org"
"https://nixpkgs-wayland.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
};
};
}