diff --git a/hosts/hades/configuration.nix b/hosts/hades/configuration.nix new file mode 100644 index 0000000..28590e3 --- /dev/null +++ b/hosts/hades/configuration.nix @@ -0,0 +1,84 @@ +{ config, pkgs, ... }: +{ + imports = [ + ./hardware-configuration.nix + ]; + + services.openssh.enable = true; + users.users.root.openssh.authorizedKeys.keys = [ + # Replace with your public key + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH3rrF3VSWI4n4cpguvlmLAaU3uftuX4AVV/39S/8GO9 alarsyo@thinkpad" + ]; + users.users.root.initialHashedPassword = ""; + services.openssh.permitRootLogin = "prohibit-password"; + users.users.alarsyo = { + password = "toto"; + isNormalUser = true; + extraGroups = [ + "media" + "networkmanager" + "video" # for `light` permissions + "docker" + "wheel" # Enable ‘sudo’ for the user. + ]; + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH3rrF3VSWI4n4cpguvlmLAaU3uftuX4AVV/39S/8GO9 alarsyo@thinkpad" + ]; + }; + + + networking.useDHCP = false; + networking.interfaces.enp35s0.ipv4.addresses = [ + { + address = "95.217.121.60"; + prefixLength = 26; + } + ]; + networking.interfaces.enp35s0.ipv6.addresses = [ + { + address = "2a01:4f9:4a:3649::2"; + prefixLength = 64; + } + ]; + networking.defaultGateway = "95.217.121.1"; + networking.defaultGateway6 = { address = "fe80::1"; interface = "enp35s0"; }; + networking.nameservers = [ "1.1.1.1" "1.0.0.1" ]; + networking.hostName = "hades"; + + boot.loader.systemd-boot.enable = false; + boot.loader.grub = { + enable = true; + efiSupport = false; + devices = [ "/dev/sda" "/dev/sdb" ]; + }; + + system.stateVersion = "22.05"; + + environment.systemPackages = with pkgs; [ + vim + tmux + git + (pkgs.callPackage "${builtins.fetchTarball "https://github.com/ryantm/agenix/archive/main.tar.gz"}/pkgs/agenix.nix" {}) + ]; + + nixpkgs.config.allowUnfree = true; + + nix = { + package = pkgs.nixStable; + + settings = { + experimental-features = ["nix-command" "flakes"]; + trusted-users = ["@wheel"]; + substituters = [ + "https://alarsyo.cachix.org" + "https://nix-community.cachix.org" + ]; + trusted-public-keys = [ + "alarsyo.cachix.org-1:A6BmcaJek5+ZDWWv3fPteHhPm6U8liS9CbDbmegPfmk=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; + +} diff --git a/hosts/hades/default.nix b/hosts/hades/default.nix index 95e529a..60ef762 100644 --- a/hosts/hades/default.nix +++ b/hosts/hades/default.nix @@ -21,7 +21,7 @@ in { boot.loader.grub = { enable = true; efiSupport = false; - devices = ["/dev/sda" "/dev/sdb"]; + devices = [ "/dev/sda" "/dev/sdb" ]; }; boot.tmpOnTmpfs = true; @@ -46,11 +46,8 @@ in { } ]; networking.defaultGateway = "95.217.121.1"; - networking.defaultGateway6 = { - address = "fe80::1"; - interface = "enp35s0"; - }; - networking.nameservers = ["1.1.1.1" "1.0.0.1"]; + networking.defaultGateway6 = { address = "fe80::1"; interface = "enp35s0"; }; + networking.nameservers = [ "1.1.1.1" "1.0.0.1" ]; my.networking.externalInterface = "enp35s0"; # List services that you want to enable: diff --git a/hosts/hades/hardware-configuration.nix b/hosts/hades/hardware-configuration.nix index 57882a3..e15d951 100644 --- a/hosts/hades/hardware-configuration.nix +++ b/hosts/hades/hardware-configuration.nix @@ -1,28 +1,24 @@ # 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 = ["ahci" "sd_mod"]; - boot.initrd.kernelModules = ["dm-snapshot"]; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ "ahci" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/2a24010c-14bd-439b-b30b-d0e18db69952"; - fsType = "ext4"; - }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/2a24010c-14bd-439b-b30b-d0e18db69952"; + fsType = "ext4"; + }; - swapDevices = []; + swapDevices = [ ]; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;