Use home-manager. Move hardware config to directory.
This commit is contained in:
parent
b9590201e7
commit
75fa5d4f0c
6 changed files with 158 additions and 47 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
**/hardware-configuration.nix
|
|
|
@ -1,15 +1,10 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
fluffychat2,
|
|
||||||
feishin0_16_0,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Include the results of the hardware scan.
|
|
||||||
imports = [ ./hardware-configuration.nix ];
|
|
||||||
|
|
||||||
# NixOS version.
|
# NixOS version.
|
||||||
system.stateVersion = "25.05";
|
system.stateVersion = "25.05";
|
||||||
|
|
||||||
|
@ -107,7 +102,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
excludePackages = with pkgs; [
|
excludePackages = with pkgs; [
|
||||||
xterm
|
xterm # Don't install xterm.
|
||||||
];
|
];
|
||||||
|
|
||||||
displayManager.gdm.enable = true;
|
displayManager.gdm.enable = true;
|
||||||
|
@ -123,9 +118,18 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.nautilus-open-any-terminal = {
|
||||||
|
enable = true;
|
||||||
|
terminal = "ghostty";
|
||||||
|
}; # Use ghostty as "open in terminal" option in file manager.
|
||||||
|
|
||||||
# Run electron apps under wayland.
|
# Run electron apps under wayland.
|
||||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
|
|
||||||
|
# Gaming packages.
|
||||||
|
programs.gamemode.enable = true;
|
||||||
|
programs.steam.enable = true;
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
|
||||||
|
@ -143,36 +147,4 @@
|
||||||
services.power-profiles-daemon.enable = lib.mkForce false; # enabled by gnome
|
services.power-profiles-daemon.enable = lib.mkForce false; # enabled by gnome
|
||||||
services.tlp.enable = lib.mkForce false; # enabled by nixos-hardware
|
services.tlp.enable = lib.mkForce false; # enabled by nixos-hardware
|
||||||
services.auto-cpufreq.enable = true;
|
services.auto-cpufreq.enable = true;
|
||||||
|
|
||||||
# Install some packages
|
|
||||||
programs.git.enable = true;
|
|
||||||
programs.firefox.enable = true;
|
|
||||||
programs.gamemode.enable = true;
|
|
||||||
programs.nautilus-open-any-terminal = { enable = true; terminal = "ghostty"; };
|
|
||||||
programs.steam.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
adwsteamgtk
|
|
||||||
bitwarden-desktop
|
|
||||||
discord
|
|
||||||
feishin0_16_0.feishin
|
|
||||||
filezilla
|
|
||||||
fluffychat2.fluffychat
|
|
||||||
ghostty
|
|
||||||
gimp3
|
|
||||||
glabels-qt
|
|
||||||
gnomeExtensions.rounded-window-corners-reborn
|
|
||||||
gnomeExtensions.smile-complementary-extension
|
|
||||||
jellyfin-media-player
|
|
||||||
libreoffice
|
|
||||||
nixd # nix language server
|
|
||||||
nixfmt-rfc-style # nix language formatter
|
|
||||||
obsidian
|
|
||||||
prismlauncher
|
|
||||||
protonmail-desktop
|
|
||||||
signal-desktop
|
|
||||||
smile
|
|
||||||
vscodium
|
|
||||||
yubioath-flutter
|
|
||||||
];
|
|
||||||
}
|
}
|
42
flake.lock
generated
42
flake.lock
generated
|
@ -106,12 +106,31 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1750792728,
|
||||||
|
"narHash": "sha256-Lh3dopA8DdY+ZoaAJPrtkZOZaFEJGSYjOdAYYgOPgE4=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "366f00797b1efb70f2882d3da485e3c10fd3d557",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "release-25.05",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"lanzaboote": {
|
"lanzaboote": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"crane": "crane",
|
"crane": "crane",
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
|
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
|
@ -145,6 +164,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1750622754,
|
||||||
|
"narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-25.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750576544,
|
"lastModified": 1750576544,
|
||||||
"narHash": "sha256-8myT+IxNWIB1B66NNDzQCXc5apy6pIXLW49m4qCRHFs=",
|
"narHash": "sha256-8myT+IxNWIB1B66NNDzQCXc5apy6pIXLW49m4qCRHFs=",
|
||||||
|
@ -160,7 +195,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750838302,
|
"lastModified": 1750838302,
|
||||||
"narHash": "sha256-aVkL3/yu50oQzi2YuKo0ceiCypVZpZXYd2P2p1FMJM4=",
|
"narHash": "sha256-aVkL3/yu50oQzi2YuKo0ceiCypVZpZXYd2P2p1FMJM4=",
|
||||||
|
@ -206,9 +241,10 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"feishin0_16_0": "feishin0_16_0",
|
"feishin0_16_0": "feishin0_16_0",
|
||||||
"fluffychat2": "fluffychat2",
|
"fluffychat2": "fluffychat2",
|
||||||
|
"home-manager": "home-manager",
|
||||||
"lanzaboote": "lanzaboote",
|
"lanzaboote": "lanzaboote",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
|
|
21
flake.nix
21
flake.nix
|
@ -5,6 +5,7 @@
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; # Stable nixpkgs.
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; # Stable nixpkgs.
|
||||||
lanzaboote.url = "github:nix-community/lanzaboote"; # Secure boot.
|
lanzaboote.url = "github:nix-community/lanzaboote"; # Secure boot.
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware"; # Hardware specific config.
|
nixos-hardware.url = "github:NixOS/nixos-hardware"; # Hardware specific config.
|
||||||
|
home-manager.url = "github:nix-community/home-manager/release-25.05"; # Manage user home directories.
|
||||||
|
|
||||||
# Updated packages.
|
# Updated packages.
|
||||||
fluffychat2.url = "github:NixOS/nixpkgs?ref=pull/419632/head"; # FluffyChat 2.0.0
|
fluffychat2.url = "github:NixOS/nixpkgs?ref=pull/419632/head"; # FluffyChat 2.0.0
|
||||||
|
@ -17,6 +18,7 @@
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
lanzaboote,
|
lanzaboote,
|
||||||
nixos-hardware,
|
nixos-hardware,
|
||||||
|
home-manager,
|
||||||
fluffychat2,
|
fluffychat2,
|
||||||
feishin0_16_0,
|
feishin0_16_0,
|
||||||
...
|
...
|
||||||
|
@ -25,15 +27,24 @@
|
||||||
nixosConfigurations.muskduck = nixpkgs.lib.nixosSystem rec {
|
nixosConfigurations.muskduck = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
specialArgs = {
|
|
||||||
fluffychat2 = import fluffychat2 { inherit system; };
|
|
||||||
feishin0_16_0 = import feishin0_16_0 { inherit system; };
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
lanzaboote.nixosModules.lanzaboote
|
lanzaboote.nixosModules.lanzaboote
|
||||||
nixos-hardware.nixosModules.lenovo-thinkpad-t480
|
nixos-hardware.nixosModules.lenovo-thinkpad-t480
|
||||||
|
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.fern = ./home.nix;
|
||||||
|
|
||||||
|
home-manager.extraSpecialArgs = {
|
||||||
|
fluffychat2 = import fluffychat2 { inherit system; };
|
||||||
|
feishin0_16_0 = import feishin0_16_0 { inherit system; };
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
|
./hardware-configuration/muskduck.nix # Include the results of the hardware scan.
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
41
hardware-configuration/muskduck.nix
Normal file
41
hardware-configuration/muskduck.nix
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# 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" "nvme" "usb_storage" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/63d79656-aa5b-466a-b369-be5eac3f51ab";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.initrd.luks.devices."luks-93fa00bc-777f-4359-bad5-880c29faca0d".device = "/dev/disk/by-uuid/93fa00bc-777f-4359-bad5-880c29faca0d";
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/EBD7-3E1C";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# 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.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
52
home.nix
Normal file
52
home.nix
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Home manager options.
|
||||||
|
home.username = "fern";
|
||||||
|
home.homeDirectory = "/home/fern";
|
||||||
|
home.stateVersion = "25.05";
|
||||||
|
|
||||||
|
# Let Home Manager install and manage itself.
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
# Gnome extensions.
|
||||||
|
programs.gnome-shell.extensions = with pkgs.gnomeExtensions; [
|
||||||
|
{ package = rounded-window-corners-reborn; }
|
||||||
|
{ package = smile-complementary-extension; }
|
||||||
|
];
|
||||||
|
|
||||||
|
# Install some packages.
|
||||||
|
programs.git.enable = true;
|
||||||
|
programs.firefox.enable = true;
|
||||||
|
|
||||||
|
programs.ghostty = {
|
||||||
|
enable = true;
|
||||||
|
theme = "GruvboxDarkHard";
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.vscode = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.vscodium;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
adwsteamgtk
|
||||||
|
bitwarden-desktop
|
||||||
|
discord
|
||||||
|
feishin0_16_0.feishin
|
||||||
|
filezilla
|
||||||
|
fluffychat2.fluffychat
|
||||||
|
gimp3
|
||||||
|
glabels-qt
|
||||||
|
jellyfin-media-player
|
||||||
|
libreoffice
|
||||||
|
nixd # nix language server
|
||||||
|
nixfmt-rfc-style # nix language formatter
|
||||||
|
obsidian
|
||||||
|
prismlauncher
|
||||||
|
protonmail-desktop
|
||||||
|
signal-desktop
|
||||||
|
smile
|
||||||
|
yubioath-flutter
|
||||||
|
];
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue