commit 1d5ca44ee7ca7ab1be6d23944f1b484c3491a29d
parent 05698a5cce3fecc4a689ae68d222b1b72d076018
Author: Milutin Popovic <milutin@popovic.xyz>
Date: Wed, 25 Mar 2026 09:18:34 +0000
bump
Diffstat:
8 files changed, 9 insertions(+), 800 deletions(-)
diff --git a/flake.nix b/flake.nix
@@ -72,8 +72,8 @@
nixos-hardware.nixosModules.framework-13-7040-amd
home-manager.nixosModules.home-manager
sops-nix.nixosModules.sops
- ./system/host/frame.nix
- ./system/hardware/frame.nix
+ ./machines/frame/configuration.nix
+ ./machines/frame/hardware.nix
{
home-manager = {
useGlobalPkgs = true;
@@ -106,8 +106,8 @@
nixos-hardware.nixosModules.framework-13-7040-amd
home-manager.nixosModules.home-manager
sops-nix.nixosModules.sops
- ./system/host/frame.nix
- ./system/hardware/frame-unencrypted.nix
+ ./machines/frame/configuration.nix
+ ./machines/hardware/hardware-unencrypted.nix
{
home-manager = {
useGlobalPkgs = true;
@@ -139,8 +139,8 @@
};
modules = [
home-manager.nixosModules.home-manager
- ./system/host/frame.nix
- ./system/hardware/vm.nix
+ ./machines/frame/configuration.nix
+ ./machines/vm/hardware.nix
{
home-manager = {
useGlobalPkgs = true;
@@ -167,8 +167,8 @@
};
modules = [
home-manager.nixosModules.home-manager
- ./system/host/server.nix
- ./system/hardware/vm.nix
+ ./machines/server/configuration.nix
+ ./machines/server/hardware.nix
{
home-manager = {
backupFileExtension = true;
@@ -205,7 +205,7 @@
modules = [
home-manager.darwinModules.home-manager
sops-nix.darwinModules.sops
- ./system/host/mac.nix
+ ./machines/mac/configuration.nix
{
home-manager = {
useGlobalPkgs = true;
diff --git a/system/disk/vm.nix b/system/disk/vm.nix
@@ -1,40 +0,0 @@
-{
- disko.devices = {
- disk = {
- my-disk = {
- device = "/dev/vda";
- type = "disk";
- content = {
- type = "gpt";
- partitions = {
- ESP = {
- type = "EF00";
- size = "512M";
- content = {
- mountpoint = "/boot";
- type = "filesystem";
- format = "vfat";
- mountOptions = [ "umask=0077" ];
- };
- };
- swap = {
- size = "8G";
- content = {
- type ="swap";
- resumeDevice = true;
- };
- };
- root = {
- size = "100%";
- content = {
- mountpoint = "/";
- type = "filesystem";
- format = "ext4";
- };
- };
- };
- };
- };
- };
- };
-}
diff --git a/system/hardware/frame-unencrypted.nix b/system/hardware/frame-unencrypted.nix
@@ -1,34 +0,0 @@
-{ config, lib, modulesPath, ... }:
-
-{
- imports =
- [
- (modulesPath + "/installer/scan/not-detected.nix")
- ];
-
- boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" ];
- boot.initrd.kernelModules = [ "dm-snapshot" ];
- boot.kernelModules = [ "kvm-amd" ];
- boot.extraModulePackages = [ ];
-
- fileSystems."/" =
- {
- device = "/dev/disk/by-uuid/69e780cc-9ee1-4987-99eb-6c452ae66855";
- fsType = "ext4";
- };
-
- fileSystems."/boot" =
- {
- device = "/dev/disk/by-uuid/7000-6EA2";
- fsType = "vfat";
- options = [ "fmask=0022" "dmask=0022" ];
- };
-
- swapDevices =
- [
- { device = "/dev/disk/by-uuid/fb532c05-67d1-4983-a518-e2616369b6ae"; }
- ];
-
- nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
- hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
-}
diff --git a/system/hardware/frame.nix b/system/hardware/frame.nix
@@ -1,42 +0,0 @@
-{ config, lib, modulesPath, ... }:
-
-{
- imports =
- [
- (modulesPath + "/installer/scan/not-detected.nix")
- ];
-
- boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" ];
- boot.initrd.kernelModules = [ "dm-snapshot" "cryptd" ];
- boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/68d936fb-68be-4351-a557-874ef2d96efc"; # <--
-
- boot.kernelModules = [ "kvm-amd" ];
- boot.extraModulePackages = [ ];
-
- fileSystems."/" =
- {
- device = "/dev/disk/by-uuid/adc85ee5-286c-44aa-9dfa-4580e59687dc";
- fsType = "ext4";
- };
- fileSystems."/home" =
- {
- device = "/dev/disk/by-uuid/2e36575d-3dc4-4760-9bc1-9bf055371805";
- fsType = "ext4";
- };
-
- fileSystems."/boot" =
- {
- device = "/dev/disk/by-uuid/F656-048E";
- fsType = "vfat";
- options = [ "fmask=0022" "dmask=0022" ];
- };
-
- swapDevices =
- [
- { device = "/dev/disk/by-uuid/f1c0a91f-0460-4ba8-a414-f49c90dfa399"; }
- ];
-
- nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
- hardware.enableAllFirmware = true;
- hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
-}
diff --git a/system/hardware/vm.nix b/system/hardware/vm.nix
@@ -1,16 +0,0 @@
-# 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 + "/profiles/qemu-guest.nix") ];
-
- boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
- boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ "kvm-amd" ];
- boot.extraModulePackages = [ ];
-
- nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
-}
diff --git a/system/host/frame.nix b/system/host/frame.nix
@@ -1,220 +0,0 @@
-{
- pkgs,
- lib,
- hostName,
- isDarwin,
- ...
-}:
-{
- imports = [
- ../../users/root.nix
- ../../modules/nix_settings.nix
- ../../modules/nm.nix
- ];
-
- sops.defaultSopsFile = ../../secrets.yaml;
- sops.defaultSopsFormat = "yaml";
- sops.age.keyFile = "/home/mika/.config/sops/age/keys.txt";
-
- system.stateVersion = "25.11";
-
- # vm
- virtualisation.vmVariant = {
- virtualisation = {
- diskSize = 50 * 1028; # 50 GB
- memorySize = 16 * 1028; # 16 GB
- cores = 6;
- resolution = {
- x = 1600;
- y = 900;
- };
- qemu.options = [
- "-enable-kvm"
- "-cpu host"
- "-display gtk,zoom-to-fit=false"
- "-vga virtio"
- ];
- };
- };
-
- virtualisation.docker = {
- enable = true;
- rootless = {
- enable = true;
- setSocketVariable = true;
- };
- };
-
- # boot
- boot = {
- loader = {
- systemd-boot.enable = true;
- efi.canTouchEfiVariables = true;
- };
- kernelPackages = pkgs.linuxPackages_latest;
- kernelParams = [
- "loglevel=3"
- "nowatchdog"
- "migrations=auto"
- "amd_iommu=on"
- "iommu=pt"
- "rtc_cmos.use_acpi_alarm=1"
- "usbcore.autosuspend=-1"
- "pcie_port_pm=off"
- "acpi.no_ec_wakup=1"
- ];
- supportedFilesystems = [
- "btrfs"
- "ext4"
- "vfat"
- "ntfs"
- ];
- };
-
- # netowrk
- networking.hostName = "${hostName}";
- networking.wireless.enable = true;
- networking.firewall.enable = false;
-
- # time/locale
- i18n.defaultLocale = "en_US.UTF-8";
-
- # programs
- programs = {
- nix-ld.enable = true;
- zsh.enable = true;
- dconf.enable = true;
- gnupg.agent = {
- enable = true;
- enableSSHSupport = true;
- };
- };
-
- environment.variables = {
- __ETC_ZSHRC_SOURCED = "1";
- __ETC_ZSHENV_SOURCED = "1";
- };
-
- # users
- users = {
- users = {
- mika = {
- isNormalUser = true;
- extraGroups = [
- "wheel"
- "docker"
- ];
- initialPassword = "123";
- shell = pkgs.zsh;
- };
- root = {
- shell = pkgs.zsh;
- };
- };
- };
- security.sudo.wheelNeedsPassword = false;
-
- powerManagement.powertop.enable = true;
-
- # services
- services = {
- automatic-timezoned.enable = true;
- gvfs.enable = true;
- udisks2.enable = true;
- upower.enable = true;
- fwupd.enable = true;
- openssh.enable = true;
- tlp.enable = false;
- power-profiles-daemon.enable = true;
- pipewire = {
- enable = true;
- alsa.enable = true;
- alsa.support32Bit = true;
- pulse.enable = true;
- };
- xserver = {
- enable = true;
- serverFlagsSection = ''
- Option "Xauth" "$XAUTHORITY"
- '';
- displayManager.startx = {
- enable = true;
- };
- };
- getty.autologinUser = "mika";
- logind.settings.Login = {
- SleepOperation = "suspend-then-hibernate";
- HandlePowerKey = "suspend-then-hibernate";
- HandleLidSwitch = "suspend-then-hibernate";
- HandlePowerKeyLongPress = "poweroff";
- };
- }
- // lib.optionalAttrs (!isDarwin) {
- gnome.gnome-keyring.enable = true;
- libinput = {
- enable = true;
- touchpad.naturalScrolling = false;
- };
- openssh = {
- enable = true;
- settings = {
- PasswordAuthentication = false;
- KbdInteractiveAuthentication = false;
- PermitRootLogin = "no";
- AllowUsers = [ "myUser" ];
- };
- };
- };
-
- systemd.sleep.settings.Sleep = {
- HibernateDelaySec = "20m";
- };
-
- systemd.network.links."10-wlan0" = {
- matchConfig.MACAddress = "14:AC:60:29:82:AB";
- linkConfig.Name = "wlan0";
- };
-
- # hardware
- hardware.bluetooth.enable = true;
- hardware.sensor.iio.enable = false; # disable light sensors
- security.rtkit.enable = true;
-
- # packages
- nixpkgs.config.allowUnfree = true;
- environment.systemPackages = with pkgs; [
- neovim
- wget
- git
- nix
- curl
- tree
- coreutils
- stdenv
- dbus-broker
- pciutils
- util-linux
- pstree
- wireguard-tools
- gnome.gvfs
- ntfs3g
-
- upower
- lm_sensors
- acpilight
- ];
-
- # fonts
- fonts.packages = with pkgs; [
- nerd-fonts.terminess-ttf
- noto-fonts
- noto-fonts-color-emoji
- terminus_font
- liberation_ttf
- fira-code
- fira-code-symbols
- ubuntu-classic
- corefonts
- ];
- fonts.fontconfig.useEmbeddedBitmaps = true;
-}
diff --git a/system/host/mac.nix b/system/host/mac.nix
@@ -1,311 +0,0 @@
-{
- pkgs,
- hostName,
- systemName,
- ...
-}:
-{
- # nix-darwin setup
- nixpkgs.hostPlatform = systemName;
- system.stateVersion = 6;
- networking.hostName = hostName;
-
- imports = [
- ../../users/root.nix
- ../../modules/nix_settings.nix
- ];
-
- environment.variables = {
- __ETC_ZSHRC_SOURCED = "1";
- __ETC_ZSHENV_SOURCED = "1";
- };
-
- # programs
- programs = {
- zsh.enable = true;
- gnupg.agent = {
- enable = true;
- enableSSHSupport = true;
- };
- };
-
- # users
- users = {
- users = {
- mika = {
- shell = pkgs.zsh;
- home = "/Users/mika";
- };
- root = {
- shell = pkgs.zsh;
- home = "/var/root";
- };
- };
- };
-
- system = {
- primaryUser = "mika";
- defaults = {
- controlcenter = {
- BatteryShowPercentage = true;
- NowPlaying = false;
- };
- CustomUserPreferences = {
- "com.apple.symbolichotkeys" = {
- "64" = {
- # Disable 'Cmd + Space' for Spotlight Search
- enabled = false;
- };
- "65" = {
- # Disable 'Cmd + Alt + Space' for Finder search window
- enabled = false;
- };
- "238" = {
- # Set 'Control + Command + C' to center focused window
- enabled = true;
- value = {
- parameters = [
- 99
- 8
- 1310720
- ];
- type = "standard";
- };
- };
- "98" = {
- # Disable 'Show Help menu'
- enabled = false;
- value = {
- parameters = [
- 47
- 44
- 1179648
- ];
- type = "standard";
- };
- };
- };
- };
- NSGlobalDomain = {
- "com.apple.sound.beep.volume" = 0.000;
- AppleInterfaceStyleSwitchesAutomatically = true;
- ApplePressAndHoldEnabled = false;
- AppleShowAllExtensions = true;
- AppleMetricUnits = 1;
- InitialKeyRepeat = 20;
- KeyRepeat = 2;
- NSAutomaticCapitalizationEnabled = false;
- NSAutomaticDashSubstitutionEnabled = false;
- NSAutomaticQuoteSubstitutionEnabled = false;
- NSAutomaticSpellingCorrectionEnabled = false;
- NSAutomaticWindowAnimationsEnabled = false;
- NSDocumentSaveNewDocumentsToCloud = false;
- NSNavPanelExpandedStateForSaveMode = true;
- PMPrintingExpandedStateForPrint = true;
- };
- trackpad = {
- TrackpadRightClick = true;
- TrackpadThreeFingerDrag = true;
- Clicking = true;
- };
- finder = {
- AppleShowAllFiles = true;
- CreateDesktop = false;
- FXDefaultSearchScope = "SCcf";
- FXEnableExtensionChangeWarning = false;
- FXPreferredViewStyle = "Nlsv";
- QuitMenuItem = true;
- ShowPathbar = true;
- ShowStatusBar = true;
- _FXShowPosixPathInTitle = true;
- _FXSortFoldersFirst = true;
- };
- dock = {
- autohide = true;
- expose-animation-duration = 0.15;
- show-recents = false;
- showhidden = true;
- persistent-apps = [ ];
- tilesize = 50;
- wvous-bl-corner = 1;
- wvous-br-corner = 1;
- wvous-tl-corner = 1;
- wvous-tr-corner = 1;
- };
- };
- keyboard = {
- enableKeyMapping = true;
- swapLeftCtrlAndFn = true;
- nonUS.remapTilde = true;
- userKeyMapping = [
- {
- HIDKeyboardModifierMappingSrc = 30064771172;
- HIDKeyboardModifierMappingDst = 30064771125;
- }
- ];
- };
- };
-
- nixpkgs.config.allowUnfree = true;
- environment.systemPackages = with pkgs; [
- neovim
- wget
- git
- nix
- curl
- tree
- coreutils
- stdenv
- pciutils
- util-linux
- pstree
- wireguard-tools
- darwin.xcode_26
- ];
-
- services.aerospace = {
- enable = true;
- settings = {
- after-startup-command = [ ];
- enable-normalization-flatten-containers = true;
- enable-normalization-opposite-orientation-for-nested-containers = true;
- accordion-padding = 30;
- default-root-container-layout = "tiles";
- default-root-container-orientation = "auto";
- on-focused-monitor-changed = [ "move-mouse monitor-lazy-center" ];
- automatically-unhide-macos-hidden-apps = false;
- on-mode-changed = [ ];
-
- key-mapping = {
- preset = "qwerty";
- };
-
- gaps = {
- inner = {
- horizontal = 10;
- vertical = 10;
- };
- outer = {
- left = 10;
- bottom = 10;
- top = 10;
- right = 10;
- };
- };
-
- mode.main.binding = {
- alt-slash = "layout tiles horizontal vertical";
- alt-comma = "layout accordion horizontal vertical";
-
- # Focus
- alt-h = "focus left";
- alt-j = "focus down";
- alt-k = "focus up";
- alt-l = "focus right";
-
- # Move
- alt-shift-h = "move left";
- alt-shift-j = "move down";
- alt-shift-k = "move up";
- alt-shift-l = "move right";
-
- # Resize
- alt-minus = "resize smart -50";
- alt-equal = "resize smart +50";
-
- # Workspace
- alt-1 = "workspace 1";
- alt-2 = "workspace 2";
- alt-3 = "workspace 3";
- alt-4 = "workspace 4";
- alt-5 = "workspace 5";
- alt-6 = "workspace 6";
- alt-7 = "workspace 7";
- alt-8 = "workspace 8";
- alt-9 = "workspace 9";
-
- # Move node to workspace
- alt-shift-1 = "move-node-to-workspace 1";
- alt-shift-2 = "move-node-to-workspace 2";
- alt-shift-3 = "move-node-to-workspace 3";
- alt-shift-4 = "move-node-to-workspace 4";
- alt-shift-5 = "move-node-to-workspace 5";
- alt-shift-6 = "move-node-to-workspace 6";
- alt-shift-7 = "move-node-to-workspace 7";
- alt-shift-8 = "move-node-to-workspace 8";
- alt-shift-9 = "move-node-to-workspace 9";
-
- alt-enter = "exec-and-forget open -n /Users/mika/Applications/kitty.app";
- alt-c = "exec-and-forget open -n /Users/mika/Applications/Firefox.app";
- alt-shift-w = "exec-and-forget open -n /Users/mika/Applications/Spotify.app";
- alt-shift-q = "close --quit-if-last-window";
- alt-m = "exec-and-forget /Users/mika/Applications/kitty.app/Contents/MacOS/kitty neomutt";
- alt-f = "fullscreen";
-
- # Workspace navigation
- alt-tab = "workspace-back-and-forth";
- alt-shift-tab = "move-workspace-to-monitor --wrap-around next";
-
- # Mode
- alt-shift-semicolon = "mode service";
- };
-
- mode.service.binding = {
- esc = [
- "reload-config"
- "mode main"
- ];
- r = [
- "flatten-workspace-tree"
- "mode main"
- ];
- f = [
- "layout floating tiling"
- "mode main"
- ];
- backspace = [
- "close-all-windows-but-current"
- "mode main"
- ];
- alt-shift-h = [
- "join-with left"
- "mode main"
- ];
- alt-shift-j = [
- "join-with down"
- "mode main"
- ];
- alt-shift-k = [
- "join-with up"
- "mode main"
- ];
- alt-shift-l = [
- "join-with right"
- "mode main"
- ];
- };
- };
- };
-
- homebrew = {
- enable = true;
- user = "mika";
- prefix = "/opt/homebrew";
- brews = [
- "cocoapods"
- "fastlane"
- "watchman"
- ];
- casks = [ ];
- onActivation = {
- autoUpdate = true;
- upgrade = true;
- cleanup = "zap";
- };
- };
-
- fonts.packages = with pkgs; [
- nerd-fonts.terminess-ttf
- terminus_font
- ];
-}
diff --git a/system/host/server.nix b/system/host/server.nix
@@ -1,128 +0,0 @@
-{
- pkgs,
- hostName,
- ...
-}:
-{
- imports = [
- ../../users/root.nix
- ../../modules/nix_settings.nix
- ];
-
- system.stateVersion = "25.11";
-
- # vm
- virtualisation.vmVariant = {
- virtualisation = {
- diskSize = 50 * 1028; # 50 GB
- memorySize = 16 * 1028; # 16 GB
- cores = 6;
- resolution = {
- x = 1600;
- y = 900;
- };
- qemu.options = [
- "-enable-kvm"
- "-cpu host"
- "-display gtk,zoom-to-fit=false"
- "-vga virtio"
- ];
- forwardPorts = [
- {
- from = "host";
- host.port = 2222;
- guest.port = 61745;
- }
- ];
- };
- };
-
- # boot
- boot = {
- loader = {
- systemd-boot.enable = true;
- efi.canTouchEfiVariables = true;
- };
- kernelPackages = pkgs.linuxPackages_latest;
- kernelParams = [
- "loglevel=3"
- "nowatchdog"
- "migrations=auto"
- ];
- };
-
- # netowrk
- networking = {
- hostName = "${hostName}";
- networkmanager.enable = true;
- };
-
- # time/locale
- i18n.defaultLocale = "en_US.UTF-8";
-
- # users
- users.users = {
- r2d2 = {
- isNormalUser = true;
- extraGroups = [ "wheel" ];
- initialPassword = "123";
- shell = pkgs.zsh;
- openssh.authorizedKeys.keys = [
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCjUjMsWMlPY0YNtSPMdmCIBnNHzT8PdN7Gc0a+RuQg2slRe7Gh1HgRPAX0pg3CIh0oNTDfuOGrOTcl/SdX+WdhChZJkcoKiDKPB98TCioJnYF9k1vouhx0P3soN/Bd4gQEd2Vx0+XTQzmK9VhFtBoNQt9Eh90ZGCrBtsfPB9odDuymotI9FPXSboUPAe3WttzzUeTpY3JurInHW2rCQsYIvti0ZGwdm6EwVjN+6aZ300uT6olrAc+6csyOZrdQQXm1G35x6MLKpYoyFoGQYkS/4vvHMbzj9F9zp8Y+aUZ0+iQvK2owhS7auzELuO2/nqwODCHXLxn8Sg15r0XJn4tVvgAxqvtG+i0SIeqjfrzsu+fg1n2tJGCAq96nyOCruYHcmLOQ0Z9d+hf04Y1thS4GCtNmqT/RGdboDI1xEmg3PaUUPgaL7pCiG+6OtTC/4F0/f/m6neRn219UAPshI7LZKT1aRsBCqKRnEmbUSKWa0ilDntCDsST2VcHwKk0Tjnb+UIvjoHJ2qQQao7i1dmzZ8oUu/9wpyt5aaNxxvcm6qfjht1TGw/1RBHyhOsPNrlHpzUtzbvDdVwHfO0/6eksb73kJ7WMqU+FutbF5ekogcUzkYMo6G7O6hDMFb+w405ontM5syg6OcYWTq2+kllbKiGETxQpizzuWKERCExpHWQ== mika@frame"
- ];
- };
- root = {
- shell = pkgs.zsh;
- };
- };
- security.sudo.wheelNeedsPassword = false;
-
- # services
- services = {
- fwupd.enable = true;
- automatic-timezoned.enable = true;
- openssh = {
- enable = true;
- ports = [ 61745 ];
- settings = {
- PermitRootLogin = "no";
- PasswordAuthentication = false;
- };
- };
- };
-
- # programs
- programs = {
- zsh.enable = false;
- dconf.enable = true;
- gnupg.agent = {
- enable = true;
- enableSSHSupport = true;
- };
- };
-
- environment.variables = {
- __ETC_ZSHRC_SOURCED = "1";
- __ETC_ZSHENV_SOURCED = "1";
- };
-
- # packages
- nixpkgs.config.allowUnfree = true;
- environment.systemPackages = with pkgs; [
- neovim
- wget
- zsh
- git
- curl
- tree
- coreutils
- stdenv
- util-linux
- pstree
- ];
-
- # fonts
- fonts.packages = with pkgs; [
- terminus_font
- ];
-}