]> jxnshi.xyz Git - nix-config.git/commitdiff
Cant find hardware_configuration.nix
authorjxnshi <jxnshi@proton.me>
Sat, 25 Jan 2025 10:11:22 +0000 (11:11 +0100)
committerjxnshi <jxnshi@proton.me>
Sat, 25 Jan 2025 10:11:22 +0000 (11:11 +0100)
.gitignore [new file with mode: 0644]
configuration.nix
flake.nix
hardware-configuration.nix [new file with mode: 0644]
home.nix

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..301d47e
--- /dev/null
@@ -0,0 +1 @@
+flake.lock
index 500dbd0af37fea94da802559672387db490c5f70..03a95ceec3693a1aac4f3c62ca0b950d828112dd 100644 (file)
@@ -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;
 
     # 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
+    '';
 }
index f4e10256f9eb9296ce11d9203a5ec5bafa2973f8..753c247e9ce1d1c55b961ca4a4db1f5dc110badc 100644 (file)
--- 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 (file)
index 0000000..f50126c
--- /dev/null
@@ -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;
+}
index fe090c2050eb58957b2b077cc7dc0403860a5c4f..547eb639060442558c241d1e2d8cdcf5fb5e86a5 100644 (file)
--- 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.
         home-manager
         htop
         pfetch-rs
-        syncthing
+        picom
         tabbed
+        timg
         tree
+        upower
         xclip
         wget
     ];
         })
     ];
 
+    # Fish.
+    programs.fish.enable = true;
+
+    programs.fish.interactiveShellInit = ''
+        set fish_greeting
+        pfetch
+    '';
+
     # Helix.
     programs.helix.enable = true;