From babcd2727cbafde85a7c797011dc2fef2b4be661 Mon Sep 17 00:00:00 2001 From: jxnshi Date: Sat, 25 Jan 2025 11:11:22 +0100 Subject: [PATCH] Cant find hardware_configuration.nix --- .gitignore | 1 + configuration.nix | 13 ++++++++++++- flake.nix | 2 +- hardware-configuration.nix | 32 ++++++++++++++++++++++++++++++++ home.nix | 16 +++++++++++++++- 5 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 hardware-configuration.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..301d47e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +flake.lock diff --git a/configuration.nix b/configuration.nix index 500dbd0..03a95ce 100644 --- a/configuration.nix +++ b/configuration.nix @@ -18,7 +18,7 @@ boot.loader.grub.useOSProber = true; # Networking. - networking.hostName = "nixos"; + networking.hostName = "t420"; networking.networkmanager.enable = true; # Timezone. @@ -61,6 +61,9 @@ services.displayManager.autoLogin.enable = true; services.displayManager.autoLogin.user = "jxnshi"; + # Upower. + services.upower.enable = true; + # SSH. programs.ssh.startAgent = true; @@ -73,4 +76,12 @@ # System. system.autoUpgrade.enable = true; system.stateVersion = "24.11"; + + # Fish. + programs.bash.interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; } diff --git a/flake.nix b/flake.nix index f4e1025..753c247 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ system = "x86_64-linux"; in { - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + nixosConfigurations.nixos= nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs system; }; modules = [ ./configuration.nix ]; }; diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..f50126c --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ehci_pci" "ata_piix" "firewire_ohci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/NIXOS_MAIN"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/NIXOS_BOOT"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/NIXOS_SWAP"; } + ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home.nix b/home.nix index fe090c2..547eb63 100644 --- a/home.nix +++ b/home.nix @@ -8,7 +8,11 @@ home.packages = with pkgs; [ dwm # Window manager. + fish # Shell. + gimp # Image editor. + ghostty # helix # Text editor. + krita # Drawing software. monero-gui # Monero wallet. st # Terminal emulator. vimb # Web browser. @@ -20,9 +24,11 @@ home-manager htop pfetch-rs - syncthing + picom tabbed + timg tree + upower xclip wget ]; @@ -46,6 +52,14 @@ }) ]; + # Fish. + programs.fish.enable = true; + + programs.fish.interactiveShellInit = '' + set fish_greeting + pfetch + ''; + # Helix. programs.helix.enable = true; -- 2.49.0