diff --git a/flake.nix b/flake.nix index 3896f52..fc5689d 100644 --- a/flake.nix +++ b/flake.nix @@ -43,11 +43,46 @@ }; nixosConfigurations.intelnuc = nixpkgs-unstable.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { + inherit inputs; + unstable = import nixpkgs-unstable { + system = "x86_64-linux"; + config = { allowUnfree = true; }; + }; + }; modules = [ ./hosts/generic.nix ./hosts/intelnuc/configuration.nix ./hosts/intelnuc/hardware-configuration.nix ]; }; + nixosConfigurations.huanan = nixpkgs-unstable.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit inputs; + unstable = import nixpkgs-unstable { + system = "x86_64-linux"; + config = { allowUnfree = true; }; + }; + }; + modules = [ + ./hosts/generic.nix + ./hosts/huanan/configuration.nix + ./hosts/huanan/hardware-configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.delta = import ./home/home.nix; + home-manager.extraSpecialArgs = { + inherit inputs; + unstable = import nixpkgs-unstable { + system = "x86_64-linux"; + config = { allowUnfree = true; }; + }; + }; + } + ]; + }; }; } diff --git a/home/home.nix b/home/home.nix index 65cdbb1..846d26f 100644 --- a/home/home.nix +++ b/home/home.nix @@ -124,6 +124,18 @@ }; }; + programs.ssh = { + enable = true; + matchBlocks = { + "intelnuc" = { + hostname = "192.168.3.53"; + }; + "huanan" = { + hostname = "192.168.3.106"; + }; + }; + }; + programs.fish = { enable = true; diff --git a/hosts/dlaptop/configuration.nix b/hosts/dlaptop/configuration.nix index ed6db44..30d3833 100644 --- a/hosts/dlaptop/configuration.nix +++ b/hosts/dlaptop/configuration.nix @@ -31,7 +31,6 @@ QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; QT_QPA_PLATFORM = "wayland"; NIXOS_OZONE_WL = "1"; - FLAKE = "/home/delta/Documents/dotfiles"; }; networking = { @@ -205,7 +204,6 @@ adw-gtk3 any-nix-shell openconnect - micro oath-toolkit expect ffmpegthumbnailer diff --git a/hosts/generic.nix b/hosts/generic.nix index a7113b6..d6353f7 100644 --- a/hosts/generic.nix +++ b/hosts/generic.nix @@ -1,4 +1,4 @@ -{ inputs, config, pkgs, ... }: +{ unstable, inputs, config, pkgs, ... }: let run = pkgs.writeScriptBin "run" '' #!/usr/bin/env bash @@ -9,6 +9,10 @@ let fi ''; in { + environment.sessionVariables = { + FLAKE = "/home/delta/Documents/dotfiles"; + }; + users.users.delta = { isNormalUser = true; description = "delta"; @@ -35,7 +39,8 @@ in { git micro nano - nh + unstable.nh + any-nix-shell ]; programs.command-not-found.enable = false; diff --git a/hosts/huanan/configuration.nix b/hosts/huanan/configuration.nix new file mode 100644 index 0000000..4c8f6ae --- /dev/null +++ b/hosts/huanan/configuration.nix @@ -0,0 +1,45 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ inputs, unstable, config, pkgs, ... }: + +{ + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/nvme0n1"; + boot.loader.grub.useOSProber = true; + + networking.hostName = "huanan"; + networking.networkmanager.enable = true; + time.timeZone = "Europe/Moscow"; + + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_TIME = "ru_RU.UTF-8"; + }; + + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + + services.printing.enable = true; + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + services.openssh.enable = true; + networking.firewall.enable = false; + system.stateVersion = "23.11"; # Did you read the comment? +} \ No newline at end of file diff --git a/hosts/huanan/hardware-configuration.nix b/hosts/huanan/hardware-configuration.nix new file mode 100644 index 0000000..c69791a --- /dev/null +++ b/hosts/huanan/hardware-configuration.nix @@ -0,0 +1,26 @@ +# 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. +{ inputs, unstable, config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/63db5f65-03bf-455e-ad82-36307c29df79"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/intelnuc/configuration.nix b/hosts/intelnuc/configuration.nix index 648fcce..1f154d5 100644 --- a/hosts/intelnuc/configuration.nix +++ b/hosts/intelnuc/configuration.nix @@ -15,8 +15,6 @@ extraGroups = [ "networkmanager" "wheel" "docker"]; }; - nixpkgs.config.allowUnfree = true; - environment.systemPackages = with pkgs; [ git vim diff --git a/hosts/intelnuc/hardware-configuration.nix b/hosts/intelnuc/hardware-configuration.nix index 588cf18..264687b 100644 --- a/hosts/intelnuc/hardware-configuration.nix +++ b/hosts/intelnuc/hardware-configuration.nix @@ -22,14 +22,7 @@ [ { device = "/dev/disk/by-uuid/3ab7f83d-71ac-4317-ade1-70e83e3e243f"; } ]; - # 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..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }