1
0

feat: rewrite to more nixy flakes

This commit is contained in:
2026-03-10 17:41:28 +01:00
parent 2c8cf957ee
commit d41abb956a
36 changed files with 1610 additions and 779 deletions
+55 -88
View File
@@ -2,31 +2,20 @@
config,
pkgs,
lib,
hostname,
env,
...
}:
let
stateVersion = "25.05";
env = import ./.env.nix { inherit pkgs; };
mpkgs = import ./pkgs/default.nix {
config = {
system.stateVersion = stateVersion;
};
};
in
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
(import (./. + "/${env.hostname}.nix"))
mpkgs.home-manager.module
];
imports = [ ./hardware-configuration.nix ] ++ lib.optional (env ? nixosModule) env.nixosModule;
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
(import "${fetchTarball "https://github.com/nix-community/fenix/archive/main.tar.gz"}/overlay.nix")
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
chromium
@@ -43,17 +32,10 @@ in
fzf
ripgrep
(fenix.stable.withComponents [
"rustc"
"cargo"
"clippy"
"rust-src"
"rustfmt"
"rust-analyzer"
])
# perhaps set up lsps through dev shells someday?
nodejs_latest
prettierd
typescript-language-server
prettierd
pnpm
nixd
nixfmt
@@ -70,8 +52,8 @@ in
jetbrains-mono
nerd-fonts.symbols-only
inter
times-newer-roman
(mpkgs.font.monaco)
nimbus-roman
monaco
];
fonts.fontconfig = {
@@ -87,7 +69,7 @@ in
"Inter"
"Noto Sans"
];
serif = [ "Times Newer Roman" ];
serif = [ "Nimbus Roman" ];
};
};
@@ -97,16 +79,13 @@ in
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
rofi
i3status
];
};
displayManager.startx.enable = true;
# Configure keymap in X11
xkb = {
layout = "us";
variant = "";
@@ -118,16 +97,14 @@ in
greetd = {
enable = true;
restart = false;
settings = {
default_session = {
command = lib.concatStringsSep " " [
"${lib.getExe pkgs.tuigreet}"
"--remember"
"--asterisks"
"--time"
];
user = "greeter";
};
settings.default_session = {
command = lib.concatStringsSep " " [
"${lib.getExe pkgs.tuigreet}"
"--remember"
"--asterisks"
"--time"
];
user = "greeter";
};
};
};
@@ -136,10 +113,10 @@ in
programs.fish.enable = true;
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
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
'';
# Define a user account. Don't forget to set a password with passwd.
@@ -153,14 +130,6 @@ in
];
};
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
sharedModules = [ ] ++ (mpkgs.home-manager.sharedModules);
users.anton = import ./home.nix;
};
# programs.home-manager.enable = true;
programs.dconf.enable = true;
qt = {
enable = true;
@@ -168,26 +137,25 @@ in
style = "adwaita-dark";
};
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
intel-vaapi-driver
libvdpau-va-gl
mesa
];
};
hardware = {
graphics = {
enable = true;
extraPackages = with pkgs.unstable; [
intel-media-driver
intel-vaapi-driver
libvdpau-va-gl
(pkgs.mesa)
];
};
bluetooth = {
enable = true;
powerOnBoot = true;
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
settings.General = {
Experimental = true;
FastConnectable = true;
};
Policy.AutoEnable = true;
settings.Policy.AutoEnable = true;
};
};
@@ -198,26 +166,27 @@ in
services.gnome.gnome-keyring.enable = true;
# Bootloader.
boot.loader.systemd-boot = {
enable = true;
configurationLimit = 10;
boot = {
loader.systemd-boot = {
enable = true;
configurationLimit = 10;
};
loader.efi.canTouchEfiVariables = true;
kernelParams = [ "console=tty1" ];
kernelPackages = pkgs.unstable.linuxPackages_latest;
};
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelParams = [ "console=tty1" ];
networking = {
hostName = hostname;
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = env.hostname;
networking.firewall.enable = false;
networking.networkmanager.enable = true;
firewall.enable = false;
networkmanager.enable = true;
};
time.timeZone = "Europe/Stockholm";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "sv_SE.UTF-8";
LC_IDENTIFICATION = "sv_SE.UTF-8";
@@ -230,13 +199,11 @@ in
LC_TIME = "sv_SE.UTF-8";
};
nix.settings.extra-experimental-features = [ "nix-command" ];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = stateVersion; # Did you read the comment?
system.stateVersion = "25.05"; # Did you read the comment?
}