Skip to content

Commit

Permalink
system: add ucodenix to update microcode
Browse files Browse the repository at this point in the history
use upstream bcachefs-tools flake
use rc kernel, enable scx conditionally

home manager revamps
  • Loading branch information
JohnRTitor committed Aug 10, 2024
1 parent d1a718d commit 043e466
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 42 deletions.
55 changes: 45 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};

ucodenix.url = "github:e-tho/ucodenix";
browser-previews = {
url = "github:nix-community/browser-previews"; # Latest Chrome stable, beta, and dev
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
32 changes: 26 additions & 6 deletions flake/hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,40 @@
android_sdk.accept_license = true;
};
};

specialArgs = {inherit self inputs pkgs-edge systemSettings userSettings;};
in {
flake = {
nixosConfigurations.${systemSettings.hostname} = lib.nixosSystem {
specialArgs = {inherit self inputs systemSettings userSettings;};
inherit specialArgs;
modules =
[
{_module.args = {inherit pkgs-edge;};}
../default-host/configuration.nix # main nix configuration
inputs.chaotic.nixosModules.default # chaotic nix bleeding edge packages
inputs.nur.nixosModules.nur
inputs.nur.nixosModules.nur # NUR - NixOS user repository
inputs.ucodenix.nixosModules.ucodenix # ucodeNix - CPU microcode updates
inputs.nix-flatpak.nixosModules.nix-flatpak # nix-flatpak, allows flatpak declaratively

# install home-manager as NixOS module
# so that it automatically gets deployed when running `nixos-rebuild switch`
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
# backupFileExtension = ".hm.bak";
extraSpecialArgs = specialArgs // {
# extra arguments for home-manager
};
};

# make home-manager as a module of nixos
# so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch`
inputs.home-manager.nixosModules.default
home-manager.users.${userSettings.username} = {
imports = [
../home-manager
inputs.nix-flatpak.homeManagerModules.nix-flatpak
];
};
}
]
++ lib.optionals systemSettings.secureboot [inputs.lanzaboote.nixosModules.lanzaboote];
};
Expand Down
5 changes: 1 addition & 4 deletions home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
lib,
pkgs,
pkgs-edge,
inputs,
systemSettings,
userSettings,
...
}: {
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = userSettings.username;
home.homeDirectory = "/home/" + userSettings.username;

imports =
[
Expand Down
2 changes: 1 addition & 1 deletion modules-overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

nixpkgs.overlays = [
(final: prev: {
# bcachefs-tools = inputs.bcachefs-tools.packages.${pkgs.system}.bcachefs-tools;
bcachefs-tools = inputs.bcachefs-tools.packages.${pkgs.system}.bcachefs-tools;
})
];

Expand Down
6 changes: 3 additions & 3 deletions modules-overlays/uwsm/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
}: let
cfg = config.programs.uwsm;
mk_uwsm_desktop_entry = opts: (pkgs.writeTextFile {
name = lib.traceVal "${opts.name}";
text = lib.traceVal ''
name = "${opts.name}";
text = ''
[Desktop Entry]
Name=${opts.compositor_pretty_name} (with UWSM)
Comment=${opts.compositor_comment}
Exec=${lib.getExe cfg.package} start -S -- "${opts.compositor_bin_path}"
Exec=${lib.getExe cfg.package} start -S -F "${opts.compositor_bin_path}"
Type=Application
'';
destination = "/share/wayland-sessions/${opts.name}_uwsm.desktop";
Expand Down
3 changes: 0 additions & 3 deletions pkgs/global-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
inputs,
...
}: {
imports = [
inputs.nix-flatpak.nixosModules.nix-flatpak
];
environment.systemPackages =
(with pkgs; [
# System Packages
Expand Down
3 changes: 0 additions & 3 deletions pkgs/user-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
inputs,
...
}: {
imports = [
inputs.nix-flatpak.homeManagerModules.nix-flatpak
];
home.packages =
(with pkgs; [
# here is some command line tools I use frequently
Expand Down
2 changes: 1 addition & 1 deletion system/boot/kernel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pkgs,
...
}: {
boot.kernelPackages = pkgs.linuxPackages_cachyos-lto;
boot.kernelPackages = pkgs.linuxPackages_testing;

boot.extraModulePackages = with config.boot.kernelPackages; [
# zenpower is used for reading temperature, voltage, current and power
Expand Down
6 changes: 5 additions & 1 deletion system/services/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Configure system services
{
config,
lib,
pkgs,
systemSettings,
Expand All @@ -24,7 +25,7 @@
};

# Enable scx extra schedulers, only available for linux-cachyos
chaotic.scx.enable = true; # by default uses rustland
chaotic.scx.enable = (config.boot.kernelPackages.kernel.passthru.config.CONFIG_SCHED_CLASS_EXT or null) == "y"; # by default uses rustland
chaotic.scx.scheduler = "scx_bpfland";

# Accounts daemon is needed to remember passwords and other account information
Expand Down Expand Up @@ -92,4 +93,7 @@
security.polkit.enable = true; # Enable polkit for elevated prompts

# services.colord.enable = true; # For color management

services.ucodenix.enable = true;
services.ucodenix.cpuSerialNumber = "00A6-0F12-0000-0000-0000-0000";
}
10 changes: 0 additions & 10 deletions system/users.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,4 @@
else pkgs.bash;
};

home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
# backupFileExtension = ".hm.bak";

users.${userSettings.username} = import ../home-manager;
extraSpecialArgs = {
inherit self inputs pkgs-edge systemSettings userSettings;
};
};
}

0 comments on commit 043e466

Please sign in to comment.