build: use flakes for config

This commit is contained in:
matt1432 2023-09-29 23:46:34 -04:00
parent 0fb2341372
commit 045287e682
21 changed files with 84 additions and 110 deletions

View file

@ -3,12 +3,9 @@
what is currently not working: what is currently not working:
- plymouth theme has no login prompt - plymouth theme has no login prompt
- sddm theme flashes white
- autosign in to keyring
what i want to do: what i want to do:
- learn flakes
- add auto-rotate widget in ags control center - add auto-rotate widget in ags control center
- when multiple widgets open, clicking on a background one puts it forward - when multiple widgets open, clicking on a background one puts it forward

View file

@ -4,11 +4,15 @@
boot = { boot = {
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
consoleLogLevel = 0; consoleLogLevel = 0;
initrd.verbose = false;
initrd.systemd.enable = true; initrd = {
verbose = false;
systemd.enable = true;
};
loader = { loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
timeout = 2;
grub = { grub = {
enable = true; enable = true;
device = "nodev"; device = "nodev";
@ -19,15 +23,12 @@
# Because it still draws that image otherwise # Because it still draws that image otherwise
splashImage = null; splashImage = null;
}; };
timeout = 2;
}; };
extraModulePackages = with config.boot.kernelPackages; [ extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback v4l2loopback
]; ];
kernelModules = [ "kvm-amd" ];
kernelParams = [ kernelParams = [
"quiet" "quiet"
"splash" "splash"

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { pkgs, ... }:
{ {
hardware.bluetooth = { hardware.bluetooth = {
@ -12,17 +12,19 @@
services = { services = {
udev.extraRules = '' udev.extraRules = ''
# give permanent path to keyboard XF86* binds # give permanent path to keyboard XF86* binds
SUBSYSTEMS=="input", ATTRS{id/product}=="0006", ATTRS{id/vendor}=="0000", SYMLINK += "video-bus" SUBSYSTEMS=="input", ATTRS{id/product}=="0006", ATTRS{id/vendor}=="0000", SYMLINK += "video-bus"
''; '';
fwupd.enable = true; fwupd.enable = true;
# Enable CUPS to print documents. # Enable CUPS to print documents.
printing.enable = true; printing = {
printing.drivers = with pkgs; [ enable = true;
hplip drivers = with pkgs; [
]; hplip
];
};
pipewire = { pipewire = {
enable = true; enable = true;

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { ... }:
{ {
imports = [ imports = [
@ -6,5 +6,5 @@
./extra-hardware.nix ./extra-hardware.nix
./security.nix ./security.nix
./packages.nix ./packages.nix
]; ];
} }

View file

@ -1,4 +1,4 @@
{config, pkgs, lib, ...}: { pkgs, hyprland, ... }:
{ {
systemd.user.services.protonmail-bridge = { systemd.user.services.protonmail-bridge = {
@ -30,10 +30,10 @@
}; };
}; };
sessionPackages = [ sessionPackages = [
(builtins.getFlake "github:hyprwm/Hyprland").packages.x86_64-linux.default hyprland.packages.x86_64-linux.default
]; ];
defaultSession = "hyprland"; defaultSession = "hyprland";
autoLogin = { # logs out after a minute autoLogin = {
enable = true; enable = true;
user = "matt"; user = "matt";
}; };

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
services.fprintd.enable = true; services.fprintd.enable = true;
@ -11,7 +11,7 @@
services.logind.lidSwitch = "lock"; services.logind.lidSwitch = "lock";
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
# Open ports in the firewall. # Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];
@ -23,7 +23,7 @@
''; '';
security.pam.services = { security.pam.services = {
gtklock = {}; gtklock = {};
# all the changes in /etc/pam.d/* # all the changes in /etc/pam.d/*

View file

@ -1,13 +1,12 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = imports = [
[ # Include the results of the hardware scan. ./hardware-configuration.nix
./hardware-configuration.nix ./overlays/list.nix
./overlays/list.nix ./cfg/main.nix
./cfg/main.nix ./home/main.nix
./home/main.nix ];
];
networking = { networking = {
hostName = "wim"; hostName = "wim";
@ -25,20 +24,17 @@
keyMap = "ca"; keyMap = "ca";
#useXkbConfig = true; # use xkbOptions in tty. #useXkbConfig = true; # use xkbOptions in tty.
}; };
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
environment.sessionVariables = { environment.sessionVariables = {
NIXPKGS_ALLOW_UNFREE = "1"; NIXPKGS_ALLOW_UNFREE = "1";
GTK_THEME = "Dracula"; GTK_THEME = "Dracula";
QT_QPA_PLATFORMTHEME = "qt5ct"; QT_QPA_PLATFORMTHEME = "qt5ct";
QT_FONT_DPI = "125"; QT_FONT_DPI = "125";
}; };
system.autoUpgrade.channel = "https://nixos.org/channels/nixos-unstable";
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave # on your system were taken. It's perfectly fine and recommended to leave
@ -46,5 +42,4 @@
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment? system.stateVersion = "23.05"; # Did you read the comment?
} }

BIN
nixos/flake.lock Normal file

Binary file not shown.

BIN
nixos/flake.nix Normal file

Binary file not shown.

View file

@ -1,29 +1,27 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/6ae4d722-dacf-485a-8d29-b276f540dc91"; device = "/dev/disk/by-uuid/6ae4d722-dacf-485a-8d29-b276f540dc91";
fsType = "btrfs"; fsType = "btrfs";
}; };
boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/ab82b477-2477-453f-b95f-28e5553ad10d"; boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/ab82b477-2477-453f-b95f-28e5553ad10d";
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/F6E1-006D"; device = "/dev/disk/by-uuid/F6E1-006D";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { ... }:
{ {
programs.bash = { # TODO: deal with root dotfiles programs.bash = { # TODO: deal with root dotfiles
@ -29,8 +29,8 @@
"cdspell" "cdspell"
"dirspell" "dirspell"
"dotglob" "dotglob"
] ];
;
shellAliases = { shellAliases = {
sudo = "sudo "; sudo = "sudo ";
frick = "sudo $(fc -ln -1)"; frick = "sudo $(fc -ln -1)";

View file

@ -6,21 +6,21 @@ in
{ {
xdg.configFile = { xdg.configFile = {
"swayosd/style.css".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/swayosd/style.css"; "swayosd/style.css".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/swayosd/style.css";
"gtklock/config.ini".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/gtklock/config.ini"; "gtklock/config.ini".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/gtklock/config.ini";
"gtklock/style.css".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/gtklock/style.css"; "gtklock/style.css".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/gtklock/style.css";
"ripgrep".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/ripgrep"; "ripgrep".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/ripgrep";
"discord/settings.json".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/discord/settings.json"; "discord/settings.json".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/discord/settings.json";
"dolphinrc".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/dolphinrc"; "dolphinrc".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/dolphinrc";
"kdeglobals".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/kdeglobals"; "kdeglobals".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/kdeglobals";
"kiorc".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/kiorc"; "kiorc".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/kiorc";
"mimeapps.list".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/mimeapps.list"; "mimeapps.list".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/mimeapps.list";
"neofetch".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/neofetch"; "neofetch".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/neofetch";
"swappy".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/swappy"; "swappy".source = config.lib.file.mkOutOfStoreSymlink "${configDir}/swappy";
}; };
programs = { programs = {

View file

@ -1,15 +1,5 @@
{ pkgs, config, ... }: let { pkgs, config, hyprland, hyprgrass, ags, ... }: let
configDir = "/home/matt/.nix/config"; configDir = "/home/matt/.nix/config";
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
hyprland = (import flake-compat {
src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz";
}).defaultNix;
ags = (builtins.getFlake "github:Aylur/ags");
in in
{ {
home.packages = [ home.packages = [
@ -25,15 +15,16 @@ in
programs.ags = { programs.ags = {
enable = true; enable = true;
package = ags.packages.x86_64-linux.default;
configDir = config.lib.file.mkOutOfStoreSymlink "${configDir}/ags"; configDir = config.lib.file.mkOutOfStoreSymlink "${configDir}/ags";
}; };
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
package = (builtins.getFlake "github:horriblename/hyprgrass").inputs.hyprland.packages.x86_64-linux.default; package = hyprland.packages.x86_64-linux.default;
plugins = [ plugins = [
"${(builtins.getFlake "github:horriblename/hyprgrass").packages.x86_64-linux.default}/lib/libhyprgrass.so" "${hyprgrass.packages.x86_64-linux.default}/lib/libhyprgrass.so"
]; ];
extraConfig = '' extraConfig = ''

View file

@ -1,14 +1,11 @@
{ config, pkgs, ... }: { home-manager, ... }:
let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
in
{ {
## Global config to add home-manager module ## Global config to add home-manager module
############################################################################# #############################################################################
imports = imports = [
[ home-manager.nixosModules.default
(import "${home-manager}/nixos") ];
];
# Define a user account. Don't forget to set a password with 'passwd'. # Define a user account. Don't forget to set a password with 'passwd'.
users.users.matt = { users.users.matt = {

View file

@ -26,7 +26,7 @@
}; };
}; };
home.packages = with pkgs; home.packages = with pkgs;
(with python311Packages; [ (with python311Packages; [
python python
pyclip pyclip
@ -40,6 +40,12 @@
(with plasma5Packages; [ (with plasma5Packages; [
polkit-kde-agent polkit-kde-agent
qtstyleplugin-kvantum qtstyleplugin-kvantum
ark
kcharselect
kdenlive
okular
# Dolphin & co
dolphin dolphin
dolphin-plugins dolphin-plugins
kdegraphics-thumbnailers kdegraphics-thumbnailers
@ -47,11 +53,7 @@
kio kio
kio-admin # needs to be both here and in system pkgs kio-admin # needs to be both here and in system pkgs
kio-extras kio-extras
ark
kcharselect
kdenlive
kmime kmime
okular
]) ++ ]) ++
(with gnome; [ (with gnome; [
@ -59,8 +61,8 @@
seahorse seahorse
adwaita-icon-theme adwaita-icon-theme
]) ++ ]) ++ [
[
(writeShellScriptBin "Gparted" '' (writeShellScriptBin "Gparted" ''
( (
sleep 1.5 sleep 1.5
@ -79,9 +81,10 @@
# School # School
virt-manager virt-manager
gradle gradle
gradle-completion gradle-completion # not working
jdk19_headless
#camunda-modeler #camunda-modeler
#
protonmail-bridge protonmail-bridge
thunderbird thunderbird
input-emulator input-emulator
@ -102,7 +105,6 @@
qt6.qtwayland qt6.qtwayland
bottles-unwrapped bottles-unwrapped
zscroll zscroll
httrack
lisgd lisgd
zeal zeal
acpi acpi
@ -115,7 +117,6 @@
xdg-utils xdg-utils
pavucontrol # TODO: open on left click pavucontrol # TODO: open on left click
gimp-with-plugins gimp-with-plugins
jdk19_headless
bluez-tools bluez-tools
vlc vlc
discord discord
@ -149,6 +150,5 @@
squeekboard squeekboard
glib glib
appimage-run appimage-run
gparted # doesn't open without sudo
]; ];
} }

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { neovim-nightly-overlay, ... }:
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
@ -25,8 +25,6 @@
coloryou = final.callPackage ./pkgs/coloryou/default.nix {}; coloryou = final.callPackage ./pkgs/coloryou/default.nix {};
}) })
(import (builtins.fetchTarball { neovim-nightly-overlay.overlay
url = "https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz";
}))
]; ];
} }

View file

@ -1,7 +1,6 @@
{ lib { lib
, stdenv , stdenv
, fetchFromGitHub , fetchFromGitHub
, pkgs
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {

View file

@ -1,5 +1,4 @@
{ lib { stdenv
, stdenv
, meson , meson
, ninja , ninja
, pkg-config , pkg-config

View file

@ -1,8 +1,6 @@
### test package ### test package
{ lib { stdenv
, stdenv
, fetchFromGitHub , fetchFromGitHub
, pkgs
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {

View file

@ -1,5 +1,4 @@
{ lib { stdenv
, stdenv
, meson , meson
, ninja , ninja
, pkg-config , pkg-config
@ -36,7 +35,7 @@ stdenv.mkDerivation rec {
pam pam
libpam-wrapper libpam-wrapper
]; ];
mesonFlags = [ mesonFlags = [
"-Dpam_modules_dir=${placeholder "out"}/lib/security" "-Dpam_modules_dir=${placeholder "out"}/lib/security"
"-Dsysconfdir=${placeholder "out"}/etc" "-Dsysconfdir=${placeholder "out"}/etc"

View file

@ -1,13 +1,13 @@
final: prev: { final: prev: {
swayosd = prev.swayosd.overrideAttrs (oldAttrs: rec { swayosd = prev.swayosd.overrideAttrs (oldAttrs: rec {
src = prev.fetchFromGitHub { src = prev.fetchFromGitHub {
owner = "ErikReider"; owner = "ErikReider";
repo = "SwayOSD"; repo = "SwayOSD";
rev = "8159c9e9962ce19f6fb78201d4d34e5817f53b45"; rev = "8159c9e9962ce19f6fb78201d4d34e5817f53b45";
hash = "sha256-kGd4/eQkhvxEL3/LToBDjE/JIR8m6w9vdFUrRTyylCE="; hash = "sha256-kGd4/eQkhvxEL3/LToBDjE/JIR8m6w9vdFUrRTyylCE=";
}; };
cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const { cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const {
name = "swayosd-vendor.tar.gz"; name = "swayosd-vendor.tar.gz";
inherit src; inherit src;