updates config

This commit is contained in:
Dennis Schoepf 2026-03-03 21:36:01 +01:00
parent 13c76e23d1
commit acbe8a473d
16 changed files with 270 additions and 22 deletions

8
flake.lock generated
View file

@ -99,11 +99,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1772479524, "lastModified": 1772525000,
"narHash": "sha256-U+hMRvavBzJYhdWCWGRHCK3bpcKjqTJAnyii3y09uT8=", "narHash": "sha256-JVA3N5t5II0xI9+sJ44UgaN6tMrZGOox0w2xZzKYt9Q=",
"rev": "4215e62dc2cd3bc705b0a423b9719ff6be378a43", "rev": "72b1d820cb0149b40a35aa077b4b6d60cd1b23c3",
"type": "tarball", "type": "tarball",
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre957146.4215e62dc2cd/nixexprs.tar.xz" "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre957475.72b1d820cb01/nixexprs.tar.xz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",

View file

@ -22,9 +22,5 @@
inputs: inputs:
inputs.flake-parts.lib.mkFlake { inputs.flake-parts.lib.mkFlake {
inherit inputs; inherit inputs;
systems = [
"aarch64-darwin"
"x86_64-linux"
];
} (inputs.import-tree ./modules); } (inputs.import-tree ./modules);
} }

View file

@ -0,0 +1,11 @@
{ ... }:
{
imports = [
./hardware-configuration.nix
];
networking.hostName = "dnsc-machine";
environment.systemPackages = [ ];
system.stateVersion = "25.05";
}

View file

@ -0,0 +1,41 @@
# Do not modify this file! It was generated by 'nixos-generate-config'
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/30277f94-8b7b-4e91-8438-6815170edfdd";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/4DC9-7AB7";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/9b7564e7-2deb-4432-a4fc-d18d21ef2d11"; }
];
# 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;
# networking.interfaces.enp42s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp45s0f3u3u4.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -3,7 +3,7 @@ let
username = config.flake.globalConfig.username; username = config.flake.globalConfig.username;
in in
{ {
flake.modules.darwin.system = { flake.modules.darwin.base = {
system = { system = {
primaryUser = username; primaryUser = username;
stateVersion = 5; stateVersion = 5;
@ -11,6 +11,8 @@ in
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
''; '';
nix.enable = false;
defaults = { defaults = {
NSGlobalDomain."com.apple.swipescrolldirection" = false; NSGlobalDomain."com.apple.swipescrolldirection" = false;
@ -62,4 +64,54 @@ in
security.pam.services.sudo_local.touchIdAuth = true; security.pam.services.sudo_local.touchIdAuth = true;
}; };
flake.modules.nixos.base =
{ pkgs, ... }:
{
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
networking.networkmanager.enable = true;
time.timeZone = "Europe/Berlin";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
security.sudo.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.mtr.enable = true;
services.xserver.xkb.layout = "eu";
services.openssh.enable = true;
services.udisks2.enable = true;
services.udev.packages = with pkgs; [
vial
];
users.users."${username}" = {
isNormalUser = true;
extraGroups = [
"networkmanager"
"wheel"
];
};
};
} }

112
modules/base/default.nix Normal file
View file

@ -0,0 +1,112 @@
{ config, ... }:
let
username = config.flake.globalConfig.username;
in
{
flake.modules.darwin.system =
{ pkgs }:
{
system = {
primaryUser = username;
stateVersion = 5;
activationScripts.postActivation.text = ''
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
'';
defaults = {
NSGlobalDomain."com.apple.swipescrolldirection" = false;
dock = {
autohide = true;
autohide-delay = 0.01;
autohide-time-modifier = 0.01;
expose-group-apps = true;
launchanim = false;
minimize-to-application = true;
orientation = "right";
show-recents = false;
persistent-apps = [
"/Applications/Helium.app"
"/Applications/Ghostty.app"
"/System/Applications/System Settings.app/"
];
persistent-others = [
"/Users/${username}/Downloads"
];
};
finder = {
AppleShowAllExtensions = true;
CreateDesktop = false;
FXEnableExtensionChangeWarning = false;
FXPreferredViewStyle = "clmv";
ShowPathbar = true;
ShowStatusBar = true;
};
loginwindow = {
LoginwindowText = "(λ) powered by nix-darwin";
};
menuExtraClock = {
Show24Hour = true;
ShowDate = 0;
};
screencapture = {
location = "/Users/${username}/Downloads";
target = "file";
};
spaces.spans-displays = false;
};
};
security.pam.services.sudo_local.touchIdAuth = true;
};
flake.modules.nixos.system =
{ pkgs }:
{
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
networking.networkmanager.enable = true;
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
security.sudo.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.mtr.enable = true;
services.xserver.xkb.layout = "eu";
services.openssh.enable = true;
services.udisks2.enable = true;
users.users."${username}" = {
isNormalUser = true;
extraGroups = [
"networkmanager"
"wheel"
];
};
};
}

View file

@ -1,5 +1,11 @@
{ lib, ... }: { lib, ... }:
{ {
options.flake.modules = lib.mkOption {
type = lib.types.attrsOf (lib.types.lazyAttrsOf lib.types.raw);
default = { };
description = "Reusable NixOS/Darwin/home-manager modules keyed by type and name";
};
options.flake.globalConfig = { options.flake.globalConfig = {
username = lib.mkOption { username = lib.mkOption {
type = lib.types.str; type = lib.types.str;

View file

@ -4,6 +4,7 @@
... ...
}: }:
let let
hostname = "dnsc-air";
username = config.flake.globalConfig.username; username = config.flake.globalConfig.username;
in in
{ {
@ -12,10 +13,10 @@ in
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
inputs.home-manager.darwinModules.home-manager inputs.home-manager.darwinModules.home-manager
config.flake.modules.darwin.system config.flake.modules.darwin.base
{ {
networking.hostName = "dnsc-air"; networking.hostName = "${hostname}";
networking.computerName = "dnsc-air"; networking.computerName = "${hostname}";
users.users.${username}.home = "/Users/${username}"; users.users.${username}.home = "/Users/${username}";
nix.enable = false; nix.enable = false;
nix.settings.experimental-features = [ nix.settings.experimental-features = [

View file

@ -0,0 +1,11 @@
{ inputs, ... }:
{
flake.nixosConfigurations.dnsc-machine = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = with inputs.self.modules.nixos; [
base
"${inputs.self}/hosts/dnsc-machine/default.nix"
];
};
}

View file

@ -1,10 +1,9 @@
{ {
inputs, inputs,
pkgs,
... ...
}: }:
{ {
flake.modules.homeManager.neovim = { flake.modules.homeManager.neovim = { pkgs, ... }: {
imports = [ inputs.nixvim.homeModules.nixvim ]; imports = [ inputs.nixvim.homeModules.nixvim ];
programs.nixvim = { programs.nixvim = {
enable = true; enable = true;

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { ... }:
{ {
flake.modules.homeManager.neovim-editing = { flake.modules.homeManager.neovim-editing = { pkgs, ... }: {
programs.nixvim = { programs.nixvim = {
plugins.sleuth.enable = true; plugins.sleuth.enable = true;
plugins.nvim-surround.enable = true; plugins.nvim-surround.enable = true;

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { ... }:
{ {
flake.modules.homeManager.neovim-formatter = { flake.modules.homeManager.neovim-formatter = { pkgs, ... }: {
programs.nixvim.plugins.conform-nvim = { programs.nixvim.plugins.conform-nvim = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { ... }:
{ {
flake.modules.homeManager.neovim-lsp = { flake.modules.homeManager.neovim-lsp = { pkgs, ... }: {
programs.nixvim = { programs.nixvim = {
plugins.lspconfig.enable = true; plugins.lspconfig.enable = true;

View file

@ -1,6 +1,6 @@
{ pkgs, ... }: { ... }:
{ {
flake.modules.homeManager.neovim-picker = { flake.modules.homeManager.neovim-picker = { pkgs, ... }: {
programs.nixvim = { programs.nixvim = {
plugins.oil = { plugins.oil = {
enable = true; enable = true;

7
modules/systems.nix Normal file
View file

@ -0,0 +1,7 @@
{ ... }:
{
systems = [
"aarch64-darwin"
"x86_64-linux"
];
}

12
modules/vial/default.nix Normal file
View file

@ -0,0 +1,12 @@
{
flake.modules.nixos.vial =
{ pkgs }:
{
environment.systemPackages = with pkgs; [
vial
];
services.udev.packages = with pkgs; [
vial
];
};
}