diff options
| -rw-r--r-- | config/boot.nix | 9 | ||||
| -rw-r--r-- | config/default.nix | 22 | ||||
| -rw-r--r-- | config/environment.nix | 11 | ||||
| -rw-r--r-- | config/hardware/default.nix | 13 | ||||
| -rw-r--r-- | config/hardware/hardware-configuration.nix | 43 | ||||
| -rw-r--r-- | config/networking/default.nix | 13 | ||||
| -rw-r--r-- | config/nix.nix | 11 | ||||
| -rw-r--r-- | config/users.nix | 5 | ||||
| -rw-r--r-- | flake.lock | 105 | ||||
| -rw-r--r-- | flake.nix | 23 |
10 files changed, 255 insertions, 0 deletions
diff --git a/config/boot.nix b/config/boot.nix new file mode 100644 index 0000000..257f64d --- /dev/null +++ b/config/boot.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + personal.boot = { + grub.enable = true; + }; + boot.loader.grub.device = "/dev/disk/by-id/ata-SATA_SSD_A45E07221AE300053322"; + boot.kernelPackages = pkgs.linuxPackages_latest; +} diff --git a/config/default.nix b/config/default.nix new file mode 100644 index 0000000..ff22fc8 --- /dev/null +++ b/config/default.nix @@ -0,0 +1,22 @@ +{ modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/profiles/headless.nix") + (modulesPath + "/profiles/minimal.nix") + ./boot.nix + ./environment.nix + ./hardware + ./networking + ./nix.nix + ./users.nix + ]; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "22.11"; # Did you read the comment? +} diff --git a/config/environment.nix b/config/environment.nix new file mode 100644 index 0000000..61f55ff --- /dev/null +++ b/config/environment.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + personal.environment = { + enable = true; + locale.enable = true; + }; + programs.bash.promptInit = '' + PS1="\n\[\033[1;32m\][\[\e]0;\u@$(hostname -f): \w\a\]\u@$(hostname -f):\w]\$\[\033[0m\] " + ''; +} diff --git a/config/hardware/default.nix b/config/hardware/default.nix new file mode 100644 index 0000000..a6219f8 --- /dev/null +++ b/config/hardware/default.nix @@ -0,0 +1,13 @@ +{ nixos-hardware, ... }: { + imports = [ + ./hardware-configuration.nix + nixos-hardware.nixosModules.pcengines-apu + nixos-hardware.nixosModules.common-pc-ssd + nixos-hardware.nixosModules.common-cpu-amd + ]; + personal.hardware = { + usb.enable = true; + firmwareNonFree.enable = true; + }; + swapDevices = [{ device = "/swap"; }]; +} diff --git a/config/hardware/hardware-configuration.nix b/config/hardware/hardware-configuration.nix new file mode 100644 index 0000000..68cf8c9 --- /dev/null +++ b/config/hardware/hardware-configuration.nix @@ -0,0 +1,43 @@ +# 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 = [ "xhci_pci" "ahci" "ehci_pci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/9e447187-fae1-466a-b37d-4de1fe240c6f"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/47e77d74-1aad-4d99-9aa7-568d8524b305"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/b99733fc-3734-41d3-8fe5-2682714f319e"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # 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.enp2s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/config/networking/default.nix b/config/networking/default.nix new file mode 100644 index 0000000..9dac00f --- /dev/null +++ b/config/networking/default.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: + +{ + personal.networking = { + enable = true; + ssh.enable = true; + }; + + networking = { + hostName = "kerberos"; + domain = "local"; + }; +} diff --git a/config/nix.nix b/config/nix.nix new file mode 100644 index 0000000..7b8360a --- /dev/null +++ b/config/nix.nix @@ -0,0 +1,11 @@ +{ lib, ... }: + +{ + personal.nix = { + enable = true; + autoUpgrade = true; + gc.enable = true; + flake = "git+file:///etc/nixos/"; + }; + nix.settings.max-jobs = lib.mkDefault 1; +} diff --git a/config/users.nix b/config/users.nix new file mode 100644 index 0000000..36aacef --- /dev/null +++ b/config/users.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + personal.user.enable = true; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6662e79 --- /dev/null +++ b/flake.lock @@ -0,0 +1,105 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "my-nixpkgs": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "nur": "nur" + }, + "locked": { + "lastModified": 1679046461, + "narHash": "sha256-GfLN7dJc7tmyNAn7LEvS3jPyS15/6guNZzkIrldzjCs=", + "owner": "qaristote", + "repo": "my-nixpkgs", + "rev": "3fc0ae97b2a6a77fd7b31a132a85880d271e13dc", + "type": "github" + }, + "original": { + "owner": "qaristote", + "repo": "my-nixpkgs", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1679075297, + "narHash": "sha256-8TwS7NPQWW9iPejBwWzmjLnK8bQhdOMPpsj3KPAL6x8=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "994584bb26ffa1deeaf56099601ef4bcc487273e", + "type": "github" + }, + "original": { + "id": "nixos-hardware", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1677560409, + "narHash": "sha256-PIvUIsVNozPXe1FmNe9c6B8Febl3t9+51uBKMJ1Q8o0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9e56d6ec92c8fb4192f1392aa5c4101ad77f2070", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1679043548, + "narHash": "sha256-+GRsdjUm5UXVpOOQvOzcyx6FQBxZE3rmUnqc8AfRTfs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9ae25db0be36b005ac6ea70ced60eef9b0608d88", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "locked": { + "lastModified": 1677656154, + "narHash": "sha256-C+LNfSAlWyRVNiwBoYodxnrVzDymA5dR36dg1epXAk4=", + "owner": "nix-community", + "repo": "NUR", + "rev": "458246a5098156e4d8be62de85a03feec6a2e4fe", + "type": "github" + }, + "original": { + "id": "nur", + "type": "indirect" + } + }, + "root": { + "inputs": { + "my-nixpkgs": "my-nixpkgs", + "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..69898bc --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + inputs = { + my-nixpkgs.url = "github:qaristote/my-nixpkgs"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11-small"; + }; + + outputs = { self, nixpkgs, my-nixpkgs, nixos-hardware, ... }: { + nixosConfigurations = let + system = "x86_64-linux"; + commonModules = [ + my-nixpkgs.nixosModules.personal + ({ ... }: { nixpkgs.overlays = [ my-nixpkgs.overlays.default ]; }) + ]; + in { + kerberos = nixpkgs.lib.nixosSystem { + inherit system; + modules = commonModules + ++ [ ./config ]; + specialArgs = { inherit nixos-hardware; }; + }; + }; + }; +} |
