diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5eec986 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.claude diff --git a/flake.nix b/flake.nix index d803688..54e5cb6 100644 --- a/flake.nix +++ b/flake.nix @@ -44,5 +44,21 @@ } ]; }; + + nixosConfigurations.nixserve = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/nixserve + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.ulve = import ./hosts/nixserve/home.nix; + backupFileExtension = "backup"; + }; + } + ]; + }; }; } diff --git a/hosts/nixserve/default.nix b/hosts/nixserve/default.nix new file mode 100644 index 0000000..adf5180 --- /dev/null +++ b/hosts/nixserve/default.nix @@ -0,0 +1,57 @@ +{ config, pkgs, ... }: + +{ + imports = [ ./hardware-configuration.nix ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "nixserve"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Stockholm"; + + i18n.defaultLocale = "en_US.UTF-8"; + console.keyMap = "sv-latin1"; + + services.openssh = { + enable = true; + settings = { + X11Forwarding = false; + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + openFirewall = true; + }; + + users.users."ulve" = { + isNormalUser = true; + shell = pkgs.zsh; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICpiU4gStAtrJOBSkQA2YJh98fpWPpxWtWgwAGzVa/wc johansson.olov@gmail.com" + ]; + description = "ulve"; + extraGroups = [ "networkmanager" "wheel" ]; + }; + + programs.zsh.enable = true; + security.polkit.enable = true; + + environment.systemPackages = with pkgs; [ + wget + curl + git + ]; + + nixpkgs.config.allowUnfree = true; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + nix.settings.auto-optimise-store = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + system.stateVersion = "26.05"; +} diff --git a/hosts/nixserve/hardware-configuration.nix b/hosts/nixserve/hardware-configuration.nix new file mode 100644 index 0000000..c7f607c --- /dev/null +++ b/hosts/nixserve/hardware-configuration.nix @@ -0,0 +1,31 @@ +# 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 = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/4f54d9c1-e07e-4e7a-a953-153e4730fd85"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/73CD-516F"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/nixserve/home.nix b/hosts/nixserve/home.nix new file mode 100644 index 0000000..da30395 --- /dev/null +++ b/hosts/nixserve/home.nix @@ -0,0 +1,4 @@ +{config, pkgs, ...}: +{ + imports = [ ../../modules/home-common.nix ]; +}