diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2023-02-18 14:31:33 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2023-02-18 14:42:41 +0100 |
| commit | 093cb612282f48d15ba295f109660e47a22f8e39 (patch) | |
| tree | 68d61e95578bccb71f0da0d9e451c5d022d6910d /config | |
| parent | ceb94dc2b322212ee3622927f5f4c289c04a798e (diff) | |
factor out common configuration options
Diffstat (limited to 'config')
| -rw-r--r-- | config/boot.nix | 10 | ||||
| -rw-r--r-- | config/default.nix | 4 | ||||
| -rw-r--r-- | config/environment.nix | 13 | ||||
| -rw-r--r-- | config/hardware-configuration.nix | 27 | ||||
| -rw-r--r-- | config/networking.nix | 21 | ||||
| -rw-r--r-- | config/nix.nix | 12 | ||||
| -rw-r--r-- | config/store.nix | 21 | ||||
| -rw-r--r-- | config/users.nix | 8 |
8 files changed, 54 insertions, 62 deletions
diff --git a/config/boot.nix b/config/boot.nix index df60fea..910e251 100644 --- a/config/boot.nix +++ b/config/boot.nix @@ -1,12 +1,6 @@ { ... }: { - boot = { - loader.grub = { - enable = true; - version = 2; - enableCryptodisk = true; - device = "/dev/vda"; - }; - }; + personal.boot.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; } diff --git a/config/default.nix b/config/default.nix index 271ee4b..43dff7d 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,4 +1,4 @@ -{ pkgs, modulesPath, ... }: +{ modulesPath, ... }: { imports = [ @@ -7,8 +7,8 @@ ./boot.nix ./environment.nix ./networking.nix + ./nix.nix ./services - ./store.nix ./users.nix ]; diff --git a/config/environment.nix b/config/environment.nix index e812e43..61f55ff 100644 --- a/config/environment.nix +++ b/config/environment.nix @@ -1,16 +1,11 @@ { pkgs, ... }: { - environment.systemPackages = with pkgs; [ vim gitMinimal ]; + 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\] " ''; - - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "fr"; - }; - - time.timeZone = "Europe/Paris"; } diff --git a/config/hardware-configuration.nix b/config/hardware-configuration.nix new file mode 100644 index 0000000..1b79e6f --- /dev/null +++ b/config/hardware-configuration.nix @@ -0,0 +1,27 @@ +{ pkgs, lib, modulesPath, ... }: + +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + boot.initrd.availableKernelModules = + [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/2b302948-5608-41c6-b54c-1c0e39ff6a58"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."root".device = + "/dev/disk/by-uuid/eaec758b-ba22-42ab-8992-e765cec9be55"; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/74d78eba-c29a-4724-8fb7-624e0a03faa5"; + fsType = "ext4"; + }; + + swapDevices = [{ device = "/swap"; }]; + +} diff --git a/config/networking.nix b/config/networking.nix index decd84e..172834d 100644 --- a/config/networking.nix +++ b/config/networking.nix @@ -1,6 +1,12 @@ { pkgs, ... }: { + personal.networking = { + enable = true; + firewall.http = true; + ssh.enable = true; + }; + networking = { hostName = "hermes"; domain = "aristote.fr"; @@ -12,20 +18,5 @@ }]; defaultGateway = "93.95.228.1"; nameservers = [ "93.95.224.28" "93.95.224.29" ]; - - firewall = { - enable = true; - allowedTCPPorts = [ 80 443 ]; - }; - }; - - services.openssh = { - enable = true; - permitRootLogin = "no"; - passwordAuthentication = false; - extraConfig = '' - AcceptEnv PS1 - ''; }; - services.fail2ban.enable = true; } diff --git a/config/nix.nix b/config/nix.nix new file mode 100644 index 0000000..5c9278f --- /dev/null +++ b/config/nix.nix @@ -0,0 +1,12 @@ +{ lib, ... }: + +{ + personal.nix = { + enable = true; + autoUpgrade = true; + gc.enable = true; + flake = "git+file:///etc/nixos/"; + }; + nix.settings.max-jobs = lib.mkDefault 1; + system.autoUpgrade.flags = [ "--update-input" "personal-webpage/data" ]; +} diff --git a/config/store.nix b/config/store.nix deleted file mode 100644 index 8efcd5d..0000000 --- a/config/store.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ lib, ... }: - -{ - nix = { - settings = { - auto-optimise-store = true; - experimental-features = [ "nix-command" "flakes" ]; - }; - gc = { - automatic = true; - dates = "daily"; - options = "--delete-old"; - }; - settings.max-jobs = lib.mkDefault 1; - }; - system.autoUpgrade = { - enable = true; - flake = "git+file:///etc/nixos/"; - flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ]; - }; -} diff --git a/config/users.nix b/config/users.nix index 99a497d..36aacef 100644 --- a/config/users.nix +++ b/config/users.nix @@ -1,11 +1,5 @@ { ... }: { - users.users.qaristote = { - isNormalUser = true; - extraGroups = [ "wheel" ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK4wGbl3++lqCjLUhoRyABBrVEeNhIXYO4371srkRoyq qaristote@latitude-7490" - ]; - }; + personal.user.enable = true; } |
