This commit is contained in:
TheGeneralist 2025-05-30 15:05:01 +02:00
parent a86424bb64
commit 9e05e68cc4
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
6 changed files with 80 additions and 6 deletions

View file

@ -0,0 +1,33 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ self, config, pkgs, lib, inputs, ... }:
{
imports = [ ./hardware-configuration.nix ];
users.knownUsers = [
"thegeneralist"
];
users.users.thegeneralist = {
name = "thegeneralist";
home = "/Users/thegeneralist";
shell = pkgs.zsh;
uid = 501;
# openssh.authorizedKeys.keys = let
# inherit (import ../../keys.nix) thegeneralist;
# in [ thegeneralist ];
};
home-manager = {
backupFileExtension = "home.bak";
users.thegeneralist.home = {
stateVersion = "25.11";
homeDirectory = "/Users/thegeneralist";
};
};
system.stateVersion = 6;
}

View file

@ -0,0 +1,31 @@
lib: inputs: self: lib.darwinSystem {
specialArgs = inputs // { inherit inputs; inherit self; };
modules = [
# Extensions: nixosModules, darwinModules, overlays
({ pkgs, lib, inputs, ... }: let
inherit (lib) attrValues hasAttrByPath getAttrFromPath filter;
collect = packagePath: (attrValues inputs)
|> filter (hasAttrByPath packagePath)
|> map (getAttrFromPath packagePath);
modules = collect [ "darwinModules" "default" ];
# todo
extensions = {
nixpkgs.overlays = collect [ "overlays" "default" ];
imports = modules;
};
in extensions)
./configuration.nix
# Modules
({ pkgs, ... }: let
inherit (lib) filter hasSuffix;
commonModules = lib.filesystem.listFilesRecursive ../../modules/common |> filter (hasSuffix ".nix");
darwinModules = lib.filesystem.listFilesRecursive ../../modules/darwin |> filter (hasSuffix ".nix");
in {
imports = commonModules ++ darwinModules;
})
];
}

View file

@ -0,0 +1,11 @@
{ lib, ... }:
{
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
# networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-darwin";
}

View file

@ -2,7 +2,7 @@ lib: inputs: self: lib.nixosSystem {
specialArgs = inputs // { inherit inputs; inherit self; };
modules = [
# Extensions: nixosModules, darwinModules, overlays
({ pkgs, lib, ... }: let
({ pkgs, lib, inputs, ... }: let
inherit (lib) attrValues hasAttrByPath getAttrFromPath filter;
collect = packagePath: (attrValues inputs)
@ -10,7 +10,7 @@ lib: inputs: self: lib.nixosSystem {
|> map (getAttrFromPath packagePath);
modules = collect [ "nixosModules" "default" ];
extensions = modules // {
extensions = {
nixpkgs.overlays = collect [ "overlays" "default" ];
imports = modules;
};