diff --git a/flake.nix b/flake.nix index 442d643..02c7d0c 100644 --- a/flake.nix +++ b/flake.nix @@ -58,6 +58,10 @@ specialArgs = { inherit inputs rootPath; }; modules = [ ./hosts/vps/configuration.nix ]; }; + ideapad = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs rootPath; }; + modules = [ ./hosts/ideapad/configuration.nix ]; + }; }; homeConfigurations = { @@ -76,6 +80,11 @@ extraSpecialArgs = { inherit inputs rootPath; }; modules = [ ./home/hosts/y2q.nix ]; }; + "toast@ideapad" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { inherit inputs rootPath; }; + modules = [ ./home/hosts/ideapad.nix ]; + }; }; devShells = forAllSystems (system: diff --git a/home/hosts/ideapad.nix b/home/hosts/ideapad.nix new file mode 100644 index 0000000..3813b05 --- /dev/null +++ b/home/hosts/ideapad.nix @@ -0,0 +1,37 @@ +{ inputs, ... }: + +{ + imports = [ + inputs.nixvim.homeModules.nixvim + inputs.nix-flatpak.homeManagerModules.nix-flatpak + inputs.sops-nix.homeManagerModules.sops + + ../modules/graphical/waybar + ../modules/graphical/cliphist.nix + ../modules/graphical/dunst.nix + ../modules/graphical/firefox.nix + ../modules/graphical/fonts.nix + ../modules/graphical/hypridle.nix + ../modules/graphical/hyprland.nix + ../modules/graphical/hyprshot-save.nix + ../modules/graphical/kitty.nix + ../modules/graphical/powermenu.nix + ../modules/graphical/tofi.nix + ../modules/graphical/udiskie.nix + ../modules/graphical/xdg.nix + ] ++ ( + let + modulesPath = ../modules; + cliModules = builtins.attrNames (builtins.readDir (modulesPath + "/cli/")); + in + map (module: modulesPath + "/cli/${module}") cliModules + ); + home = { + username = "toast"; + homeDirectory = "/home/toast"; + stateVersion = "24.11"; + }; + + nixpkgs.config.allowUnfree = true; + systemd.user.startServices = "sd-switch"; +} diff --git a/hosts/ideapad/configuration.nix b/hosts/ideapad/configuration.nix new file mode 100644 index 0000000..ddbaeec --- /dev/null +++ b/hosts/ideapad/configuration.nix @@ -0,0 +1,35 @@ +{ inputs, ... }: + +{ + imports = + [ + inputs.sops-nix.nixosModules.sops + inputs.lanzaboote.nixosModules.lanzaboote + ./hardware-configuration.nix + ] ++ [ + ../../modules/core/packages.nix + ../../modules/core/time.nix + ../../modules/core/sops.nix + ../../modules/graphical/environment.nix + ../../modules/graphical/greetd.nix + ../../modules/graphical/hyprland.nix + ../../modules/graphical/thunar.nix + ../../modules/graphical/xfconf.nix + ../../modules/graphical/xserver.nix + ../../modules/programs/nh.nix + ../../modules/programs/nix-ld.nix + ../../modules/programs/ssh.nix + ../../modules/programs/ydotool.nix + ../../modules/programs/zsh.nix + ../../modules/services/tailscale.nix + ../../modules/services/udisks2.nix + ../../modules/services/zerotierone.nix + ../../modules/services/openssh.nix + ./modules/boot.nix + ./modules/network.nix + ./modules/users.nix + ]; + + system.stateVersion = "25.11"; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; +} diff --git a/hosts/ideapad/hardware-configuration.nix b/hosts/ideapad/hardware-configuration.nix new file mode 100644 index 0000000..b8407d7 --- /dev/null +++ b/hosts/ideapad/hardware-configuration.nix @@ -0,0 +1,34 @@ +# 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" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/da94d155-0fae-4f33-bca3-cdc55aabe718"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/8EC8-E915"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/3d1e5589-d677-4c37-803e-45e2866d59b4"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} + diff --git a/hosts/ideapad/modules/boot.nix b/hosts/ideapad/modules/boot.nix new file mode 100644 index 0000000..d66e1b8 --- /dev/null +++ b/hosts/ideapad/modules/boot.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: + +{ + boot.loader.systemd-boot.enable = lib.mkForce false; + boot.loader.efi.canTouchEfiVariables = true; + boot.supportedFilesystems = [ "ntfs" ]; + + boot.lanzaboote = { + enable = true; + pkiBundle = "/var/lib/sbctl"; + }; +} diff --git a/hosts/ideapad/modules/network.nix b/hosts/ideapad/modules/network.nix new file mode 100644 index 0000000..37c0a9b --- /dev/null +++ b/hosts/ideapad/modules/network.nix @@ -0,0 +1,5 @@ +{ + networking.hostName = "ideapad"; + networking.networkmanager.enable = true; + networking.firewall.enable = false; +} diff --git a/hosts/ideapad/modules/users.nix b/hosts/ideapad/modules/users.nix new file mode 100644 index 0000000..010ae5d --- /dev/null +++ b/hosts/ideapad/modules/users.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ + users.users.toast = { + isNormalUser = true; + description = "toast"; + extraGroups = [ "networkmanager" "wheel" "ydotool" ]; + packages = with pkgs; []; + shell = pkgs.zsh; + }; +} diff --git a/hosts/nixos/modules/services/xserver.nix b/hosts/nixos/modules/services/xserver.nix new file mode 100644 index 0000000..2872723 --- /dev/null +++ b/hosts/nixos/modules/services/xserver.nix @@ -0,0 +1,3 @@ +{ + services.xserver.videoDrivers = [ "nvidia" ]; +} diff --git a/hosts/vps/configuration.nix b/hosts/vps/configuration.nix index eca215f..986bb38 100644 --- a/hosts/vps/configuration.nix +++ b/hosts/vps/configuration.nix @@ -3,6 +3,11 @@ { imports = [ inputs.sops-nix.nixosModules.sops + + ./modules/boot.nix + ./modules/network.nix + ./modules/users.nix + ../../modules/core/filesystem.nix ../../modules/core/sops.nix ../../modules/services/tailscale.nix @@ -13,10 +18,7 @@ ../../modules/services/trilium-server.nix ../../modules/services/vaultwarden.nix ../../modules/services/zipline.nix - ./modules/boot.nix - ./modules/network.nix - ./modules/users.nix - ./modules/tailscale.nix + ./modules/services/tailscale.nix ./modules/services/restic.nix ]; diff --git a/modules/graphical/xserver.nix b/modules/graphical/xserver.nix index 29c43f6..121cc31 100644 --- a/modules/graphical/xserver.nix +++ b/modules/graphical/xserver.nix @@ -3,6 +3,5 @@ { services.xserver = { xkb.layout = "us"; - videoDrivers = [ "nvidia" ]; }; }