🧹 Organizing
Moved code to separate files. Rofi config in home-manager. Moved home.nix to /home. Scripts to format and rebuild
This commit is contained in:
parent
8e91b0ca78
commit
f60462a770
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,2 +1,8 @@
|
||||
# Autogenerated
|
||||
hardware-configuration.nix
|
||||
|
||||
# Symlink create by `nix build`
|
||||
result
|
||||
|
||||
# IDEs
|
||||
.idea
|
||||
|
@ -1,4 +1,3 @@
|
||||
# NixOS Configurations
|
||||
|
||||
WIP!
|
||||
|
||||
My NixOS configurations for my desktop
|
||||
|
@ -9,6 +9,7 @@
|
||||
wireplumber
|
||||
playerctl # Interaction with audioplayers and browsers
|
||||
pavucontrol # GUI
|
||||
spotify
|
||||
];
|
||||
|
||||
hardware.pulseaudio.enable = false; # Use Pipewire, the modern sound subsystem
|
||||
|
@ -14,22 +14,14 @@
|
||||
./terminal
|
||||
./hyprland
|
||||
./audio.nix
|
||||
./networking.nix
|
||||
./development.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = "nixos"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Oslo";
|
||||
|
||||
@ -80,43 +72,29 @@
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnupg
|
||||
wget
|
||||
git
|
||||
kitty
|
||||
swaynotificationcenter
|
||||
xdg-utils
|
||||
xdg-desktop-portal-gtk
|
||||
xdg-desktop-portal-hyprland
|
||||
hyprpolkitagent
|
||||
rofi-wayland
|
||||
kdePackages.dolphin
|
||||
kdePackages.qtwayland
|
||||
kdePackages.qtsvg
|
||||
kdePackages.qt6ct
|
||||
spotify
|
||||
protonmail-desktop
|
||||
adw-gtk3
|
||||
glib
|
||||
adwaita-icon-theme
|
||||
jetbrains.rust-rover
|
||||
jetbrains.webstorm
|
||||
vscodium
|
||||
stremio
|
||||
docker
|
||||
rustup
|
||||
nodejs
|
||||
pnpm
|
||||
fastfetch
|
||||
freetube
|
||||
nixd
|
||||
nextcloud-client
|
||||
];
|
||||
|
||||
nix = {
|
||||
settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
@ -130,14 +108,7 @@
|
||||
|
||||
gnupg.agent.enable = true;
|
||||
|
||||
hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
|
||||
kdeconnect = {
|
||||
enable = true;
|
||||
};
|
||||
kdeconnect.enable = true;
|
||||
|
||||
steam = {
|
||||
enable = true;
|
||||
@ -155,7 +126,6 @@
|
||||
security = {
|
||||
# Adds Swaylock to /etc/pam.d
|
||||
pam.services.swaylock = { };
|
||||
rtkit.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
@ -172,10 +142,6 @@
|
||||
|
||||
pcscd.enable = true;
|
||||
|
||||
tailscale = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
# Load Nvidia driver for Xorg and Wayland
|
||||
@ -201,27 +167,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
storageDriver = "btrfs";
|
||||
rootless = {
|
||||
enable = true;
|
||||
setSocketVariable = true;
|
||||
};
|
||||
};
|
||||
|
||||
qt = {
|
||||
enable = true;
|
||||
#platformTheme = "gnome";
|
||||
#style = "adwaita-dark";
|
||||
};
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
# Enable OpenGL
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
|
26
development.nix
Normal file
26
development.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
# IDEs
|
||||
jetbrains.rust-rover
|
||||
jetbrains.webstorm
|
||||
vscodium # TODO set up extensions
|
||||
# Tools
|
||||
git
|
||||
rustup
|
||||
nodejs
|
||||
pnpm
|
||||
# Formatters
|
||||
nixd
|
||||
];
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
storageDriver = "btrfs";
|
||||
rootless = {
|
||||
enable = true;
|
||||
setSocketVariable = true;
|
||||
};
|
||||
};
|
||||
}
|
@ -37,7 +37,7 @@
|
||||
home-manager.useUserPackages = true;
|
||||
# Passes inputs as an argument to home-manager
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
home-manager.users.martin = import ./home.nix;
|
||||
home-manager.users.martin = import ./home;
|
||||
}
|
||||
stylix.nixosModules.stylix
|
||||
];
|
||||
|
5
fmt
Executable file
5
fmt
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Format all .nix files using the new default nix formatter
|
||||
|
||||
nix fmt ./**.nix
|
148
home.nix
148
home.nix
@ -1,148 +0,0 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home = {
|
||||
username = "martin";
|
||||
homeDirectory = "/home/martin";
|
||||
|
||||
file = {
|
||||
".config/wlogout/hibernate.svg".source = ./home/wlogout/hibernate.svg;
|
||||
".config/wlogout/lock.svg".source = ./home/wlogout/lock.svg;
|
||||
".config/wlogout/logout.svg".source = ./home/wlogout/logout.svg;
|
||||
".config/wlogout/reboot.svg".source = ./home/wlogout/reboot.svg;
|
||||
".config/wlogout/shutdown.svg".source = ./home/wlogout/shutdown.svg;
|
||||
".config/wlogout/suspend.svg".source = ./home/wlogout/suspend.svg;
|
||||
};
|
||||
# You can update Home Manager without changing this value. See
|
||||
# the Home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
stateVersion = "24.11";
|
||||
};
|
||||
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "Martin Berg Alstad";
|
||||
userEmail = "git@martials.no";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
home-manager.enable = true;
|
||||
|
||||
kitty.enable = true;
|
||||
|
||||
nixvim = {
|
||||
enable = true;
|
||||
|
||||
clipboard.providers.wl-copy.enable = true;
|
||||
|
||||
opts = {
|
||||
number = true; # Show line numbers
|
||||
relativenumber = true; # Show relative line numbers
|
||||
|
||||
shiftwidth = 2; # Tab width should be 2
|
||||
};
|
||||
|
||||
plugins = {
|
||||
bufferline.enable = true;
|
||||
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
# TODO use nix fmt on save
|
||||
settings = { };
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
nixd.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
lualine.enable = true;
|
||||
luasnip.enable = true;
|
||||
|
||||
cmp = {
|
||||
enable = true;
|
||||
|
||||
autoEnableSources = true;
|
||||
|
||||
settings = {
|
||||
sources = [
|
||||
{ name = "nvim-lsp"; }
|
||||
{ name = "path"; }
|
||||
{ name = "buffer"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
treesitter.enable = true;
|
||||
|
||||
web-devicons.enable = true;
|
||||
};
|
||||
};
|
||||
starship = {
|
||||
enable = true;
|
||||
settings = (with builtins; fromTOML (readFile ./starship.toml)) // { };
|
||||
};
|
||||
|
||||
# Lock desktop
|
||||
swaylock.enable = true;
|
||||
# Log out and shutdown menu
|
||||
wlogout = {
|
||||
enable = true;
|
||||
layout = [
|
||||
{
|
||||
label = "lock";
|
||||
action = "sh -c '(sleep 0.5s; swaylock)' & disown";
|
||||
text = "Lock";
|
||||
keybind = "l";
|
||||
}
|
||||
{
|
||||
label = "hibernate";
|
||||
action = "systemctl hibernate";
|
||||
text = "Hibernate";
|
||||
keybind = "h";
|
||||
}
|
||||
{
|
||||
label = "logout";
|
||||
action = "loginctl terminate-user $USER";
|
||||
text = "Logout";
|
||||
keybind = "e";
|
||||
}
|
||||
{
|
||||
label = "shutdown";
|
||||
action = "systemctl poweroff";
|
||||
text = "Shutdown";
|
||||
keybind = "s";
|
||||
}
|
||||
{
|
||||
label = "suspend";
|
||||
action = "systemctl suspend";
|
||||
text = "Suspend";
|
||||
keybind = "u";
|
||||
}
|
||||
{
|
||||
label = "reboot";
|
||||
action = "systemctl reboot";
|
||||
text = "Reboot";
|
||||
keybind = "r";
|
||||
}
|
||||
];
|
||||
style = ./home/wlogout/style.css;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
gpg-agent = {
|
||||
enable = true;
|
||||
pinentryPackage = pkgs.pinentry-curses;
|
||||
};
|
||||
};
|
||||
}
|
53
home/default.nix
Normal file
53
home/default.nix
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
./nixvim
|
||||
./rofi
|
||||
./wlogout
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home = {
|
||||
username = "martin";
|
||||
homeDirectory = "/home/martin";
|
||||
# You can update Home Manager without changing this value. See
|
||||
# the Home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
stateVersion = "24.11";
|
||||
};
|
||||
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "Martin Berg Alstad";
|
||||
userEmail = "git@martials.no";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
home-manager.enable = true;
|
||||
|
||||
kitty.enable = true;
|
||||
|
||||
starship = {
|
||||
enable = true;
|
||||
settings = (with builtins; fromTOML (readFile ./starship.toml)) // { };
|
||||
};
|
||||
|
||||
# Lock desktop
|
||||
swaylock.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
gpg-agent = {
|
||||
enable = true;
|
||||
pinentryPackage = pkgs.pinentry-curses;
|
||||
};
|
||||
};
|
||||
}
|
58
home/nixvim/default.nix
Normal file
58
home/nixvim/default.nix
Normal file
@ -0,0 +1,58 @@
|
||||
# Neovim configuration for Nix
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
|
||||
clipboard.providers.wl-copy.enable = true;
|
||||
|
||||
opts = {
|
||||
number = true; # Show line numbers
|
||||
relativenumber = true; # Show relative line numbers
|
||||
|
||||
shiftwidth = 2; # Tab width should be 2
|
||||
};
|
||||
|
||||
plugins = {
|
||||
bufferline.enable = true;
|
||||
|
||||
# Formatters
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
# TODO use nix fmt on save
|
||||
settings = { };
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
nixd.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
lualine.enable = true;
|
||||
luasnip.enable = true;
|
||||
|
||||
# Completions
|
||||
cmp = {
|
||||
enable = true;
|
||||
|
||||
autoEnableSources = true;
|
||||
|
||||
# TODO complete on <tab>
|
||||
settings = {
|
||||
sources = [
|
||||
{ name = "nvim-lsp"; }
|
||||
{ name = "path"; }
|
||||
{ name = "buffer"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
treesitter.enable = true;
|
||||
|
||||
web-devicons.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
111
home/rofi/catppuccin-mocha.rasi
Normal file
111
home/rofi/catppuccin-mocha.rasi
Normal file
@ -0,0 +1,111 @@
|
||||
* {
|
||||
bg-col: #1e1e2e;
|
||||
bg-col-light: #1e1e2e;
|
||||
border-col: #1e1e2e;
|
||||
selected-col: #1e1e2e;
|
||||
blue: #89b4fa;
|
||||
fg-col: #cdd6f4;
|
||||
fg-col2: #f38ba8;
|
||||
grey: #6c7086;
|
||||
|
||||
width: 600;
|
||||
font: "JetBrainsMono Nerd Font 14";
|
||||
}
|
||||
|
||||
element-text, element-icon , mode-switcher {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
|
||||
window {
|
||||
height: 360px;
|
||||
border: 3px;
|
||||
border-color: @border-col;
|
||||
background-color: @bg-col;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
background-color: @bg-col;
|
||||
}
|
||||
|
||||
inputbar {
|
||||
children: [prompt,entry];
|
||||
background-color: @bg-col;
|
||||
border-radius: 5px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
prompt {
|
||||
background-color: @blue;
|
||||
padding: 6px;
|
||||
text-color: @bg-col;
|
||||
border-radius: 3px;
|
||||
margin: 20px 0px 0px 20px;
|
||||
}
|
||||
|
||||
textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: ":";
|
||||
}
|
||||
|
||||
entry {
|
||||
padding: 6px;
|
||||
margin: 20px 0px 0px 10px;
|
||||
text-color: @fg-col;
|
||||
background-color: @bg-col;
|
||||
}
|
||||
|
||||
listview {
|
||||
border: 0px 0px 0px;
|
||||
padding: 6px 0px 0px;
|
||||
margin: 10px 0px 0px 20px;
|
||||
columns: 2;
|
||||
lines: 5;
|
||||
background-color: @bg-col;
|
||||
}
|
||||
|
||||
element {
|
||||
padding: 5px;
|
||||
background-color: @bg-col;
|
||||
text-color: @fg-col ;
|
||||
}
|
||||
|
||||
element-icon {
|
||||
size: 25px;
|
||||
}
|
||||
|
||||
element selected {
|
||||
background-color: @selected-col ;
|
||||
text-color: @fg-col2 ;
|
||||
}
|
||||
|
||||
mode-switcher {
|
||||
spacing: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 10px;
|
||||
background-color: @bg-col-light;
|
||||
text-color: @grey;
|
||||
vertical-align: 0.5;
|
||||
horizontal-align: 0.5;
|
||||
}
|
||||
|
||||
button selected {
|
||||
background-color: @bg-col;
|
||||
text-color: @blue;
|
||||
}
|
||||
|
||||
message {
|
||||
background-color: @bg-col-light;
|
||||
margin: 2px;
|
||||
padding: 2px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
textbox {
|
||||
padding: 6px;
|
||||
margin: 20px 0px 0px 20px;
|
||||
text-color: @blue;
|
||||
background-color: @bg-col-light;
|
||||
}
|
24
home/rofi/default.nix
Normal file
24
home/rofi/default.nix
Normal file
@ -0,0 +1,24 @@
|
||||
# App runner
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
# TODO get theme to work
|
||||
# theme = lib.mkDefault ./catppuccin-mocha.rasi;
|
||||
extraConfig = {
|
||||
modi = "run,drun,window";
|
||||
icon-theme = "Oranchelo";
|
||||
show-icons = true;
|
||||
terminal = "kitty";
|
||||
drun-display-format = "{icon} {name}";
|
||||
disable-history = false;
|
||||
hide-scrollbar = true;
|
||||
display-drun = " Apps ";
|
||||
display-run = " Run ";
|
||||
display-window = " Window";
|
||||
display-Network = " Network";
|
||||
sidebar-mode = true;
|
||||
};
|
||||
};
|
||||
}
|
56
home/wlogout/default.nix
Normal file
56
home/wlogout/default.nix
Normal file
@ -0,0 +1,56 @@
|
||||
# Log out and shutdown menu
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
home.file = {
|
||||
".config/wlogout/hibernate.svg".source = ./hibernate.svg;
|
||||
".config/wlogout/lock.svg".source = ./lock.svg;
|
||||
".config/wlogout/logout.svg".source = ./logout.svg;
|
||||
".config/wlogout/reboot.svg".source = ./reboot.svg;
|
||||
".config/wlogout/shutdown.svg".source = ./shutdown.svg;
|
||||
".config/wlogout/suspend.svg".source = ./suspend.svg;
|
||||
};
|
||||
|
||||
programs.wlogout = {
|
||||
enable = true;
|
||||
layout = [
|
||||
{
|
||||
label = "lock";
|
||||
action = "sh -c '(sleep 0.5s; swaylock)' & disown";
|
||||
text = "Lock";
|
||||
keybind = "l";
|
||||
}
|
||||
{
|
||||
label = "hibernate";
|
||||
action = "systemctl hibernate";
|
||||
text = "Hibernate";
|
||||
keybind = "h";
|
||||
}
|
||||
{
|
||||
label = "logout";
|
||||
action = "loginctl terminate-user $USER";
|
||||
text = "Logout";
|
||||
keybind = "e";
|
||||
}
|
||||
{
|
||||
label = "shutdown";
|
||||
action = "systemctl poweroff";
|
||||
text = "Shutdown";
|
||||
keybind = "s";
|
||||
}
|
||||
{
|
||||
label = "suspend";
|
||||
action = "systemctl suspend";
|
||||
text = "Suspend";
|
||||
keybind = "u";
|
||||
}
|
||||
{
|
||||
label = "reboot";
|
||||
action = "systemctl reboot";
|
||||
text = "Reboot";
|
||||
keybind = "r";
|
||||
}
|
||||
];
|
||||
style = ./style.css;
|
||||
};
|
||||
}
|
@ -1,8 +1,17 @@
|
||||
{ ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./waybar.nix
|
||||
./wallpaper.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
swaynotificationcenter
|
||||
];
|
||||
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
}
|
||||
|
22
networking.nix
Normal file
22
networking.nix
Normal file
@ -0,0 +1,22 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName = "nixos";
|
||||
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
};
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
5
rebuild
Executable file
5
rebuild
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Rebuild and switch the environment if successful
|
||||
git add .
|
||||
sudo nixos-rebuild switch --flake .#
|
Loading…
x
Reference in New Issue
Block a user