From 29cbf8b2d86bd0d9c85d112bc38e9bdf300d5127 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sun, 2 Nov 2025 15:04:04 +0000 Subject: [PATCH] flakify --- flake.lock | 26 +++++++++ flake.nix | 22 ++++++++ hardware-configuration.nix | 9 --- networking.nix | 35 ------------ services/default.nix | 3 +- configuration.nix => system/configuration.nix | 12 +--- system/default.nix | 7 +++ system/hardware-configuration.nix | 10 ++++ system/networking.nix | 55 +++++++++++++++++++ 9 files changed, 124 insertions(+), 55 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 hardware-configuration.nix delete mode 100644 networking.nix rename configuration.nix => system/configuration.nix (56%) create mode 100644 system/default.nix create mode 100644 system/hardware-configuration.nix create mode 100644 system/networking.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a7a3210 --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1761597516, + "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-25.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d614834 --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "distrust.network Flake"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-25.05"; + }; + + outputs = { + self, + nixpkgs, + ... + }: let + lib = nixpkgs.lib; + in { + nixosConfigurations = { + distrust = lib.nixosSystem { + system = "x86_64-linux"; + modules = [./system ./services]; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index 5e7b44e..0000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ modulesPath, ... }: -{ - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.loader.grub.device = "/dev/sda"; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; - boot.initrd.kernelModules = [ "nvme" ]; - fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; - -} diff --git a/networking.nix b/networking.nix deleted file mode 100644 index 82e5ddc..0000000 --- a/networking.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ lib, ... }: { - # This file was populated at runtime with the networking - # details gathered from the active system. - networking = { - nameservers = [ "213.136.95.10" - "213.136.95.11" - "2a02:c207::1" "8.8.8.8" - ]; - defaultGateway = "157.173.112.1"; - defaultGateway6 = { - address = "fe80::1"; - interface = "eth0"; - }; - dhcpcd.enable = false; - usePredictableInterfaceNames = lib.mkForce false; - interfaces = { - eth0 = { - ipv4.addresses = [ - { address="157.173.124.100"; prefixLength=20; } - ]; - ipv6.addresses = [ - { address="2a02:c207:2288:2816::1"; prefixLength=64; } -{ address="fe80::250:56ff:fe5d:f07e"; prefixLength=64; } - ]; - ipv4.routes = [ { address = "157.173.112.1"; prefixLength = 32; } ]; - ipv6.routes = [ { address = "fe80::1"; prefixLength = 128; } ]; - }; - - }; - }; - services.udev.extraRules = '' - ATTR{address}=="00:50:56:5d:f0:7e", NAME="eth0" - - ''; -} diff --git a/services/default.nix b/services/default.nix index 2f1ebbb..f83aa83 100644 --- a/services/default.nix +++ b/services/default.nix @@ -1,4 +1,4 @@ -{...}: { +{ imports = [ ./caddy.nix ./tor.nix @@ -6,7 +6,6 @@ ./nextcloud.nix ./forgejo.nix ./akkoma.nix - #./matrix.nix ./prosody.nix ./lldap.nix ]; diff --git a/configuration.nix b/system/configuration.nix similarity index 56% rename from configuration.nix rename to system/configuration.nix index e06756f..685ec2e 100644 --- a/configuration.nix +++ b/system/configuration.nix @@ -1,13 +1,7 @@ -{ pkgs,... }: { - imports = [ - ./hardware-configuration.nix - ./networking.nix # generated at runtime by nixos-infect - ./services - ]; +{pkgs, ...}: { + environment.systemPackages = with pkgs; [vim btop git alejandra statix deadnix]; - environment.systemPackages = with pkgs; [ vim btop git alejandra ]; - - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; boot.tmp.cleanOnBoot = true; zramSwap.enable = true; diff --git a/system/default.nix b/system/default.nix new file mode 100644 index 0000000..165c2fa --- /dev/null +++ b/system/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./configuration.nix + ./hardware-configuration.nix + ./networking.nix + ]; +} diff --git a/system/hardware-configuration.nix b/system/hardware-configuration.nix new file mode 100644 index 0000000..329ed8a --- /dev/null +++ b/system/hardware-configuration.nix @@ -0,0 +1,10 @@ +{modulesPath, ...}: { + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; + boot.loader.grub.device = "/dev/sda"; + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"]; + boot.initrd.kernelModules = ["nvme"]; + fileSystems."/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; +} diff --git a/system/networking.nix b/system/networking.nix new file mode 100644 index 0000000..c6c626e --- /dev/null +++ b/system/networking.nix @@ -0,0 +1,55 @@ +{lib, ...}: { + # This file was populated at runtime with the networking + # details gathered from the active system. + networking = { + nameservers = [ + "213.136.95.10" + "213.136.95.11" + "2a02:c207::1" + "8.8.8.8" + ]; + defaultGateway = "157.173.112.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; + }; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce false; + interfaces = { + eth0 = { + ipv4.addresses = [ + { + address = "157.173.124.100"; + prefixLength = 20; + } + ]; + ipv6.addresses = [ + { + address = "2a02:c207:2288:2816::1"; + prefixLength = 64; + } + { + address = "fe80::250:56ff:fe5d:f07e"; + prefixLength = 64; + } + ]; + ipv4.routes = [ + { + address = "157.173.112.1"; + prefixLength = 32; + } + ]; + ipv6.routes = [ + { + address = "fe80::1"; + prefixLength = 128; + } + ]; + }; + }; + }; + services.udev.extraRules = '' + ATTR{address}=="00:50:56:5d:f0:7e", NAME="eth0" + + ''; +}