This commit is contained in:
danny 2024-12-12 23:18:44 +08:00
parent 53395d3971
commit c2f85fddb8
14 changed files with 144 additions and 324 deletions

259
flake.lock generated
View file

@ -1,287 +1,64 @@
{ {
"nodes": { "nodes": {
"crane": {
"inputs": {
"flake-compat": ["lanzaboote", "flake-compat"],
"flake-utils": ["lanzaboote", "flake-utils"],
"nixpkgs": ["lanzaboote", "nixpkgs"],
"rust-overlay": ["lanzaboote", "rust-overlay"]
},
"locked": {
"lastModified": 1681177078,
"narHash": "sha256-ZNIjBDou2GOabcpctiQykEQVkI8BDwk7TyvlWlI4myE=",
"owner": "ipetkov",
"repo": "crane",
"rev": "0c9f468ff00576577d83f5019a66c557ede5acf6",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": ["nixpkgs"]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1711124527,
"narHash": "sha256-nCTtAShwdthp+scvmLevc06gtY9gglXq2vCdsszTqIA=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "d1f6bbea177a3542d9ad3ecead77089b65e09963",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": ["lanzaboote", "nixpkgs"]
},
"locked": {
"lastModified": 1680392223,
"narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": ["lanzaboote", "pre-commit-hooks-nix", "nixpkgs"]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": ["nixpkgs"] "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1710888565, "lastModified": 1733951536,
"narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=", "narHash": "sha256-Zb5ZCa7Xj+0gy5XVXINTSr71fCfAv+IKtmIXNrykT54=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce", "rev": "1318c3f3b068cdcea922fa7c1a0a1f0c96c22f5f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.11", "ref": "release-24.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"lanzaboote": {
"inputs": {
"crane": "crane",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"flake-utils": "flake-utils_2",
"nixpkgs": ["nixpkgs"],
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1682802423,
"narHash": "sha256-Fb5TeRTdvUlo/5Yi2d+FC8a6KoRLk2h1VE0/peMhWPs=",
"owner": "nix-community",
"repo": "lanzaboote",
"rev": "64b903ca87d18cef2752c19c098af275c6e51d63",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "v0.3.0",
"repo": "lanzaboote",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1711124224, "lastModified": 1733808091,
"narHash": "sha256-l0zlN/3CiodvWDtfBOVxeTwYSRz93muVbXWSpaMjXxM=", "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "56528ee42526794d413d6f244648aaee4a7b56c0", "rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-23.11", "ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1678872516,
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1711001935, "lastModified": 1733749988,
"narHash": "sha256-URtGpHue7HHZK0mrHnSf8wJ6OmMKYSsoLmJybrOLFSQ=", "narHash": "sha256-+5qdtgXceqhK5ZR1YbP1fAUsweBIrhL38726oIEAtDs=",
"owner": "NixOS", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "20f77aa09916374aa3141cbc605c955626762c9a", "rev": "bc27f0fde01ce4e1bfec1ab122d72b7380278e68",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"type": "indirect" "repo": "nixpkgs",
}
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": ["lanzaboote", "flake-compat"],
"flake-utils": ["lanzaboote", "flake-utils"],
"gitignore": "gitignore",
"nixpkgs": ["lanzaboote", "nixpkgs"],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1681413034,
"narHash": "sha256-/t7OjNQcNkeWeSq/CFLYVBfm+IEnkjoSm9iKvArnUUI=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "d3de8f69ca88fb6f8b09e5b598be5ac98d28ede5",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github" "type": "github"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"firefox-addons": "firefox-addons",
"home-manager": "home-manager", "home-manager": "home-manager",
"lanzaboote": "lanzaboote",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable"
} }
},
"rust-overlay": {
"inputs": {
"flake-utils": ["lanzaboote", "flake-utils"],
"nixpkgs": ["lanzaboote", "nixpkgs"]
},
"locked": {
"lastModified": 1682129965,
"narHash": "sha256-1KRPIorEL6pLpJR04FwAqqnt4Tzcm4MqD84yhlD+XSk=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "2c417c0460b788328220120c698630947547ee83",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -3,46 +3,37 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager/release-24.11"; home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.3.0";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =
{ self, nixpkgs, nixpkgs-unstable, home-manager, lanzaboote, ... }@inputs: { self, nixpkgs-unstable, nixpkgs, ... }@inputs:
let let
lib = nixpkgs.lib;
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = import nixpkgs { inherit system; };
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; pkgsUnstable = import nixpkgs-unstable { inherit system; };
in { in {
nixosConfigurations.nixos-personal = lib.nixosSystem { nixosConfigurations.dn-nix = nixpkgs.lib.nixosSystem {
inherit system;
modules = modules =
[ ./system/configuration.nix lanzaboote.nixosModules.lanzaboote ]; [
specialArgs = { inherit pkgs-unstable; }; ./system/configuration.nix
inputs.home-manager.nixosModules.default
];
specialArgs = { inherit inputs; inherit pkgsUnstable; };
}; };
homeConfigurations = { # homeConfigurations = {
danny = home-manager.lib.homeManagerConfiguration { # danny = home-manager.lib.homeManagerConfiguration {
inherit pkgs; # inherit pkgs;
modules = [ ./home ]; # modules = [ ./home ];
extraSpecialArgs = { # extraSpecialArgs = {
inherit pkgs-unstable; # inherit pkgs-unstable;
inherit inputs; # inherit inputs;
}; # };
}; # };
}; # };
# programs.home-manager.enable = true;
}; };
} }

View file

@ -1,10 +1,78 @@
{ config, pkgs, pkgs-unstable, lib, inputs, ... }: { config, pkgs, pkgsUnstable, ... }:
{ {
imports = [ ./user ]; imports = [ ./user ];
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "danny"; home.username = "danny";
home.homeDirectory = "/home/danny"; home.homeDirectory = "/home/danny";
home.stateVersion = "24.11";
}
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
pkgs.firefox
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/danny/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

View file

@ -1,6 +1,6 @@
{ {
home.sessionVariables = { home.sessionVariables = {
BROWSER = "firefox"; BROWSER = "opera";
EDITOR = "nvim"; EDITOR = "nvim";
TERMINAL = "kitty"; TERMINAL = "kitty";
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";

View file

@ -1,13 +1,15 @@
{ pkgs, pkgs-unstable, ... }: { pkgs, ... }:
{ {
home.packages = [ home.packages = [
pkgs.opera
pkgs.discord
# Dev stuff # Dev stuff
pkgs.gcc pkgs.gcc
pkgs.go pkgs.go
pkgs.lua pkgs.lua
pkgs.nodejs_21
pkgs.nodePackages.pnpm pkgs.nodePackages.pnpm
(pkgs.python3.withPackages (pkgs.python3.withPackages
(python-pkgs: [ python-pkgs.pip python-pkgs.requests ])) (python-pkgs: [ python-pkgs.pip python-pkgs.requests ]))
@ -33,7 +35,7 @@
# Utils # Utils
pkgs.viewnior pkgs.viewnior
pkgs-unstable.hyprshot pkgs.hyprshot
pkgs.catppuccin-cursors.macchiatoBlue pkgs.catppuccin-cursors.macchiatoBlue
pkgs.catppuccin-gtk pkgs.catppuccin-gtk
# pkgs.papirus-folders # pkgs.papirus-folders

View file

@ -1,17 +1,2 @@
{ inputs, ... }: { { inputs, ... }: {
programs.firefox = {
enable = true;
profiles.danny = {
extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
darkreader
proton-pass
to-google-translate
view-image
# ublock-origin
];
};
};
programs.home-manager.enable = true;
} }

View file

@ -11,22 +11,17 @@ let
sudo /run/current-system/bin/switch-to-configuration boot sudo /run/current-system/bin/switch-to-configuration boot
''; '';
rebuild = "sudo nixos-rebuild switch --flake ~/.dotfiles/"; rebuild = "sudo nixos-rebuild switch --flake /etc/nixos/#dn-nix";
fullRebuild =
"sudo nixos-rebuild switch --flake ~/.dotfiles/ && home-manager switch --flake ~/.dotfiles/ -b backup";
homeRebuild = "home-manager switch --flake ~/.dotfiles/ -b backup";
}; };
in { in {
programs = { programs = {
zsh = { zsh = {
enable = true; enable = true;
enableAutosuggestions = true; autosuggestion.enable = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
initExtra = '' initExtra = ''
source ~/.p10k.zsh && source ~/.p10k.zsh &&
eval "$(zoxide init --cmd cd zsh)" && eval "$(zoxide init --cmd cd zsh)" &&
export PATH="$PATH:/home/gpskwlkr/.dotnet/tools"
''; '';
shellAliases = myAliases; shellAliases = myAliases;
oh-my-zsh = { oh-my-zsh = {

View file

@ -1,8 +1,15 @@
{ config, lib, pkgs, ... }: { lib, pkgs, inputs, ... }:
{ {
imports = [ ./hardware-configuration.nix ./modules ]; imports = [ ./hardware-configuration.nix ./modules inputs.home-manager.nixosModules.default ];
system.stateVersion = "24.11"; system.stateVersion = "24.11";
home-manager = {
backupFileExtension = "backup";
extraSpecialArgs = { inherit inputs; };
users = {
"danny" = import ../home;
};
};
} }

View file

@ -8,39 +8,31 @@
[ (modulesPath + "/installer/scan/not-detected.nix") [ (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [ "vmd" "dm-raid" "xhci_pci" "thunderbolt" "nvme" "usbhid" "uas" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/8ca9da60-ed9c-463f-9457-403c857e57ca"; { device = "/dev/disk/by-label/nixos";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/53FB-FC91"; { device = "/dev/disk/by-label/BOOT";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
}; };
fileSystems."/home/gpskwlkr/HDD" = swapDevices = [ ];
{ device = "/dev/disk/by-uuid/44f1cc80-e2ff-4ac8-bdc3-83811ebface2";
fsType = "ext4";
options = [ "defaults,noatime" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/bd3dbbfd-b19b-4372-a436-ae649edf79ee"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (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 # 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`. # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true; # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View file

@ -2,7 +2,9 @@
{ {
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
# boot.initrd.verbose = true;
boot.initrd.systemd.enable = true;
boot.swraid.enable = true; boot.swraid.enable = true;
boot.swraid.mdadmConf = boot.swraid.mdadmConf =
"\n MAILADDR smitty\n ARRAY /dev/md126 metadata=1.2 name=stuff:0\n UUID=3b0b7c51:2681:407e:a22a:e965a8aeece7\n "; "\n MAILADDR smitty\n ARRAY /dev/md126 metadata=1.2 name=stuff:0\n UUID=3b0b7c51-2681-407e-a22a-e965a8aeece7\n ";
} }

View file

@ -2,9 +2,9 @@
{ {
documentation.nixos.enable = false; documentation.nixos.enable = false;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix = { nix = {
settings = { settings = {
warn-dirty = false; warn-dirty = false;

View file

@ -2,6 +2,8 @@
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
firefox
opera
bat bat
btop btop
eza eza

View file

@ -8,7 +8,7 @@
xserver = { xserver = {
enable = true; enable = true;
layout = "us"; xkb.layout = "us";
}; };
displayManager = { displayManager = {

View file

@ -1,7 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sound.enable = true;
security.rtkit.enable = true; security.rtkit.enable = true;
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;