diff --git a/configuration.nix b/configuration.nix index 1f230c7..3908f07 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,11 +2,16 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, inputs, ... }: +{ + config, + pkgs, + inputs, + ... +}: { - imports = - [ # Include the results of the hardware scan. + imports = [ + # Include the results of the hardware scan. ./hardware-configuration.nix ./imports.nix ]; @@ -18,11 +23,3 @@ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "25.11"; # Did you read the comment? } - - - - - - - - diff --git a/flake.nix b/flake.nix index c4beb9e..1297486 100644 --- a/flake.nix +++ b/flake.nix @@ -7,16 +7,32 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { self, nixpkgs, home-manager, ... }: + outputs = + { + self, + nixpkgs, + home-manager, + ... + }: let pkgs = nixpkgs.legacyPackages.x86_64-linux; in - { - nixosConfigurations = { - marty-pc = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ ./configuration.nix ./marty-pc.nix ]; + { + nixosConfigurations = { + marty-pc = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ./marty-pc.nix + ]; + }; + marty-server = nixpkgs.lib.nixosSystem { + system = "x86_64"; + modules = [ + ./configuration.nix + ./marty-server.nix + ]; + }; }; }; - }; } diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 14869bc..ce6b7e3 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -1,32 +1,48 @@ # 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, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/a26cdc8b-abc9-47cf-ad33-c81e56e56d22"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/a26cdc8b-abc9-47cf-ad33-c81e56e56d22"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/C9B2-7254"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/24ecde92-b41b-4e41-8ebc-950d321db477"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/C9B2-7254"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/24ecde92-b41b-4e41-8ebc-950d321db477"; } + ]; # 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 diff --git a/imports.nix b/imports.nix index 9652001..5881ab0 100644 --- a/imports.nix +++ b/imports.nix @@ -1,7 +1,13 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ - ./boot.nix + ./system/imports.nix + ./modules/imports.nix ]; } diff --git a/marty-pc.nix b/marty-pc.nix index bbc869d..a044997 100644 --- a/marty-pc.nix +++ b/marty-pc.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { networking = { diff --git a/marty-server.nix b/marty-server.nix new file mode 100644 index 0000000..05ba475 --- /dev/null +++ b/marty-server.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + networking = { + hostName = "marty-server"; + interfaces = { + eno1 = { + wakeOnLan = { + enable = true; + policy = [ "magic" ]; + }; + }; + }; + }; + + fileSystems = { + "/mnt/Data" = { + device = "/dev/disk/by-uuid/20eaea9c-6924-40c6-a784-cd5018d8fabb"; + fsType = "ext4"; + }; + }; +} diff --git a/modules/git.nix b/modules/git.nix new file mode 100644 index 0000000..5372713 --- /dev/null +++ b/modules/git.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + programs = { + git = { + enable = true; + config = { + init = { + defaultBranch = "main"; + }; + user = { + email = "marty@marty.tf"; + name = "marty"; + }; + push = { + autoSetupRemote = true; + }; + credential.helper = "libsecret"; + }; + }; + }; +} diff --git a/modules/imports.nix b/modules/imports.nix new file mode 100644 index 0000000..3a057b1 --- /dev/null +++ b/modules/imports.nix @@ -0,0 +1,12 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ + ./git.nix + ]; +} diff --git a/boot.nix b/system/boot.nix similarity index 91% rename from boot.nix rename to system/boot.nix index 625805b..d5076f5 100644 --- a/boot.nix +++ b/system/boot.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { system = { diff --git a/system/imports.nix b/system/imports.nix new file mode 100644 index 0000000..3d1ec92 --- /dev/null +++ b/system/imports.nix @@ -0,0 +1,12 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ + ./boot.nix + ]; +}