Unified home and system modules!
This commit is contained in:
52
flake.nix
52
flake.nix
@@ -32,9 +32,7 @@
|
||||
specialArgs = { inherit lib inputs system; };
|
||||
modules = [
|
||||
|
||||
./system/modules
|
||||
./system/profiles
|
||||
./system/hosts/reykjavik
|
||||
./hosts/reykjavik
|
||||
|
||||
{
|
||||
imports =
|
||||
@@ -43,44 +41,28 @@
|
||||
++ (lib.my.mapModulesRec' (toString ./modules) import);
|
||||
}
|
||||
|
||||
];
|
||||
};
|
||||
|
||||
# - Kopavogur ----------------------------
|
||||
kopavogur = lib.nixosSystem {
|
||||
inherit system;
|
||||
inherit pkgs;
|
||||
specialArgs = { inherit lib inputs system; };
|
||||
modules = [
|
||||
|
||||
./hosts/kopavogur
|
||||
|
||||
{
|
||||
home-manager.users.marc = {
|
||||
imports = [
|
||||
./home/modules
|
||||
./home/profiles
|
||||
./home/hosts/reykjavik.nix
|
||||
];
|
||||
};
|
||||
imports =
|
||||
[ inputs.home-manager.nixosModules.home-manager ]
|
||||
# All my personal modules
|
||||
++ (lib.my.mapModulesRec' (toString ./modules) import);
|
||||
}
|
||||
|
||||
];
|
||||
};
|
||||
|
||||
# - Kopavogur ----------------------------
|
||||
# kopavogur = lib.nixosSystem {
|
||||
# inherit system;
|
||||
# inherit pkgs;
|
||||
# modules = [
|
||||
|
||||
# ./system/modules
|
||||
# ./system/profiles
|
||||
# ./system/hosts/kopavogur
|
||||
|
||||
# home-manager.nixosModules.home-manager {
|
||||
# home-manager.useGlobalPkgs = true;
|
||||
# home-manager.useUserPackages = true;
|
||||
# home-manager.users.marc = {
|
||||
# imports = [
|
||||
# ./home/modules
|
||||
# ./home/profiles
|
||||
# ./home/hosts/kopavogur.nix
|
||||
# ];
|
||||
# };
|
||||
# }
|
||||
|
||||
# ];
|
||||
# };
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
home.stateVersion = "22.05";
|
||||
|
||||
samfelag = {
|
||||
profiles = {
|
||||
desktop.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
home.stateVersion = "22.05";
|
||||
|
||||
samfelag = {
|
||||
modules = {
|
||||
app = {
|
||||
discord.enable = true;
|
||||
spotify.enable = true;
|
||||
};
|
||||
editors.emacs.enable = true;
|
||||
};
|
||||
profiles = {
|
||||
desktop.enable = true;
|
||||
gaming.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# ./alacritty.nix
|
||||
./discord.nix
|
||||
./spotify.nix
|
||||
];
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./app
|
||||
./desktop
|
||||
./dev
|
||||
./editors
|
||||
./shell
|
||||
];
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./i3.nix
|
||||
./polybar.nix
|
||||
];
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./git.nix
|
||||
];
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.dev.git;
|
||||
in {
|
||||
|
||||
options.samfelag.modules.dev.git = {
|
||||
enable = lib.mkEnableOption "git config";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
||||
userName = "marc";
|
||||
userEmail = "marc@sastre.cat";
|
||||
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./emacs.nix
|
||||
];
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{ config, inputs, lib, options, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.editors.emacs;
|
||||
in {
|
||||
options.samfelag.modules.editors.emacs = {
|
||||
enable = mkEnableOption "emacs";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# xdg.configFile."doom".src = ../../../config/doom;
|
||||
};
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.shell;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./zsh.nix
|
||||
];
|
||||
|
||||
options.samfelag.modules.shell = {
|
||||
enable = mkEnableOption "Basic shell config";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
bat
|
||||
exa
|
||||
fd
|
||||
fzf
|
||||
jq
|
||||
ripgrep
|
||||
tldr
|
||||
];
|
||||
|
||||
xdg.configFile."shell".source = ../../../config/.config/shell;
|
||||
};
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
samfelag.modules = {
|
||||
|
||||
shell = {
|
||||
enable = true;
|
||||
zsh = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
dev.git.enable = true;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./common.nix
|
||||
./desktop.nix
|
||||
./gaming.nix
|
||||
];
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.profiles.desktop;
|
||||
laptopPkgs = with pkgs; [
|
||||
];
|
||||
in
|
||||
{
|
||||
options.samfelag.profiles.desktop = {
|
||||
enable = mkEnableOption "desktop profile";
|
||||
laptop = mkOption {
|
||||
description = "Add packages required when machine is a laptop";
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# - Dependencies -----------------------------
|
||||
|
||||
samfelag.modules = {
|
||||
desktop = {
|
||||
i3 = {
|
||||
enable = true;
|
||||
launcher.command = "${pkgs.rofi}/bin/rofi rofi -show run";
|
||||
terminal.command = "${pkgs.alacritty}/bin/alacritty";
|
||||
browser.command = "${pkgs.firefox}/bin/firefox";
|
||||
locker.command = "${pkgs.i3lock-blur}/bin/i3lock-color -c 808F85 && sleep 1";
|
||||
};
|
||||
|
||||
polybar.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.picom.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
rofi
|
||||
firefox
|
||||
|
||||
brightnessctl
|
||||
playerctl
|
||||
feh
|
||||
] ++ optionals cfg.laptop laptopPkgs;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.profiles.gaming;
|
||||
in
|
||||
{
|
||||
options.samfelag.profiles.gaming = {
|
||||
enable = mkEnableOption "gaming profile";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# - Dependencies -----------------------------
|
||||
|
||||
samfelag.modules = {
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
lutris
|
||||
];
|
||||
|
||||
};
|
||||
}
|
||||
46
hosts/kopavogur/default.nix
Normal file
46
hosts/kopavogur/default.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
# - Basic --------------------------------------
|
||||
|
||||
user.name = "marc";
|
||||
user.shell = pkgs.zsh;
|
||||
networking.hostName = "kopavogur";
|
||||
|
||||
# - Bootloader ---------------------------------
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.loader.grub.useOSProber = true;
|
||||
|
||||
# - Modules ------------------------------------
|
||||
|
||||
samfelag.modules = {
|
||||
# - Common -----------------------------------
|
||||
# See modules/common.nix for common packages installed
|
||||
|
||||
# - System -----------------------------------
|
||||
|
||||
# - Desktop ----------------------------------
|
||||
desktop = {
|
||||
enable = true;
|
||||
laptop = true;
|
||||
|
||||
};
|
||||
|
||||
# - Editors and development ------------------
|
||||
editors.emacs.enable = true;
|
||||
|
||||
dev.git.userName = "marc";
|
||||
dev.git.userEmail = "marc@sastre.cat";
|
||||
|
||||
# - Other apps -------------------------------
|
||||
app.spotify.enable = true;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
50
hosts/reykjavik/default.nix
Normal file
50
hosts/reykjavik/default.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./nvidia.nix
|
||||
];
|
||||
|
||||
# - Basic --------------------------------------
|
||||
|
||||
user.name = "marc";
|
||||
user.shell = pkgs.zsh;
|
||||
networking.hostName = "reykjavik";
|
||||
|
||||
# - Bootloader ---------------------------------
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
# - Modules ------------------------------------
|
||||
|
||||
samfelag.modules = {
|
||||
# - Common -----------------------------------
|
||||
# See modules/common.nix for common packages installed
|
||||
|
||||
# - System -----------------------------------
|
||||
system.bluetooth.enable = true;
|
||||
|
||||
# - Desktop ----------------------------------
|
||||
desktop = {
|
||||
enable = true;
|
||||
laptop = true;
|
||||
|
||||
};
|
||||
|
||||
# - Editors and development ------------------
|
||||
editors.emacs.enable = true;
|
||||
|
||||
dev.git.userName = "marc";
|
||||
dev.git.userEmail = "marc@sastre.cat";
|
||||
|
||||
# - Other apps -------------------------------
|
||||
app.spotify.enable = true;
|
||||
|
||||
# - Gaming -----------------------------------
|
||||
gaming.lutris.enable = true;
|
||||
gaming.steam.enable = true;
|
||||
app.discord.enable = true;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,21 +1,18 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.app.alacritty;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.app.alacritty = {
|
||||
enable = mkEnableOption "alacritty";
|
||||
enable = lib.mkEnableOption "alacritty";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
hm.home.packages = with pkgs; [
|
||||
alacritty
|
||||
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
||||
];
|
||||
|
||||
home.configFile."alacritty".source = ../../config/.config/alacritty;
|
||||
hm.xdg.configFile."alacritty".source = ../../config/.config/alacritty;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ in
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
hm.home.packages = with pkgs; [
|
||||
discord
|
||||
];
|
||||
};
|
||||
@@ -1,16 +1,14 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.app.spotify;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.app.spotify = {
|
||||
enable = mkEnableOption "spotify";
|
||||
enable = lib.mkEnableOption "spotify";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
config = lib.mkIf cfg.enable {
|
||||
hm.home.packages = with pkgs; [
|
||||
spotify
|
||||
];
|
||||
};
|
||||
@@ -1,8 +1,15 @@
|
||||
# Common module
|
||||
# -------------
|
||||
# All configuration common to ANY host is located here.
|
||||
# General configuration and "bare minimum" tools
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# - Nix ----------------------------------------
|
||||
|
||||
system.stateVersion = "22.05";
|
||||
|
||||
nix = {
|
||||
package = pkgs.nixFlakes;
|
||||
|
||||
@@ -37,15 +44,19 @@
|
||||
pciutils
|
||||
psmisc
|
||||
vim
|
||||
zsh
|
||||
];
|
||||
|
||||
# - Other --------------------------------------
|
||||
# - Modules ------------------------------------
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
networking.firewall.checkReversePath = "loose"; # See https://github.com/tailscale/tailscale/issues/4432
|
||||
samfelag.modules.tailscale.enable = true;
|
||||
|
||||
system.stateVersion = "22.05";
|
||||
samfelag.modules = {
|
||||
shell.utils.enable = true;
|
||||
shell.zsh.enable = true;
|
||||
dev.git.enable = true;
|
||||
|
||||
# May go away from common if not all hosts use it
|
||||
system.tailscale.enable = true;
|
||||
};
|
||||
|
||||
}
|
||||
68
modules/desktop/desktop.nix
Normal file
68
modules/desktop/desktop.nix
Normal file
@@ -0,0 +1,68 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.desktop;
|
||||
laptopPkgs = with pkgs; [
|
||||
];
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.desktop = {
|
||||
|
||||
enable = mkEnableOption "desktop environment";
|
||||
|
||||
laptop = mkOption {
|
||||
description = "Enable features for a laptop (trackpad, battery, etc...)";
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# - Packages ---------------------------------
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
pamixer
|
||||
i3lock-blur
|
||||
brightnessctl
|
||||
playerctl
|
||||
feh
|
||||
rofi
|
||||
firefox
|
||||
] ++ optionals cfg.laptop laptopPkgs;
|
||||
|
||||
# - Audio ------------------------------------
|
||||
|
||||
sound.enable = true;
|
||||
|
||||
hardware = {
|
||||
pulseaudio = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
package = pkgs.pulseaudioFull;
|
||||
};
|
||||
};
|
||||
|
||||
# - Compositor -------------------------------
|
||||
|
||||
services.picom.enable = true;
|
||||
|
||||
# - Modules ----------------------------------
|
||||
|
||||
samfelag.modules = {
|
||||
app.alacritty.enable = true;
|
||||
desktop.polybar.enable = true;
|
||||
desktop.i3 = {
|
||||
enable = true;
|
||||
laptop = cfg.laptop;
|
||||
launcher.command = "${pkgs.rofi}/bin/rofi rofi -show run";
|
||||
terminal.command = "${pkgs.alacritty}/bin/alacritty";
|
||||
browser.command = "${pkgs.firefox}/bin/firefox";
|
||||
locker.command = "${pkgs.i3lock-blur}/bin/i3lock-color -c 808F85 && sleep 1";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
@@ -18,12 +18,24 @@ let
|
||||
});
|
||||
|
||||
system_mode = "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown";
|
||||
|
||||
bg_colour = "#808F85";
|
||||
|
||||
paths = {
|
||||
wallpapers = ../../data/wallpapers;
|
||||
};
|
||||
|
||||
in {
|
||||
|
||||
options.samfelag.modules.desktop.i3 = {
|
||||
enable = lib.mkEnableOption "i3 window manager";
|
||||
|
||||
laptop = lib.mkOption {
|
||||
description = "Enable features for a laptop (trackpad, battery, etc...)";
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
launcher = lib.mkOption {
|
||||
type = cmdModule;
|
||||
};
|
||||
@@ -42,15 +54,45 @@ in {
|
||||
|
||||
# - Dependencies -----------------------------
|
||||
|
||||
home.packages = with pkgs; [
|
||||
environment.systemPackages = with pkgs; [
|
||||
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
||||
];
|
||||
|
||||
xdg.dataFile."wallpapers".source = ../../../data/wallpapers;
|
||||
hm.xdg.dataFile."wallpapers".source = paths.wallpapers;
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
||||
libinput = lib.mkIf cfg.laptop {
|
||||
enable = true;
|
||||
touchpad.tapping = true;
|
||||
};
|
||||
|
||||
desktopManager = {
|
||||
xterm.enable = false;
|
||||
};
|
||||
|
||||
displayManager = {
|
||||
defaultSession = "none+i3";
|
||||
lightdm = {
|
||||
enable = true;
|
||||
greeters.mini = {
|
||||
enable = true;
|
||||
user = "marc";
|
||||
extraConfig = ''
|
||||
[greeter]
|
||||
show-sys-info = true
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
windowManager.i3.enable = true;
|
||||
};
|
||||
|
||||
# - Configuration ----------------------------
|
||||
|
||||
xsession.windowManager.i3 = {
|
||||
hm.xsession.windowManager.i3 = {
|
||||
enable = true;
|
||||
|
||||
config = {
|
||||
@@ -64,7 +106,7 @@ in {
|
||||
|
||||
focus.followMouse = false;
|
||||
|
||||
bars = [ ];
|
||||
bars = [ ];
|
||||
|
||||
window = {
|
||||
border = 1;
|
||||
@@ -76,11 +118,10 @@ in {
|
||||
# outer = 5;
|
||||
# };
|
||||
|
||||
startup = [
|
||||
startup = [
|
||||
{ command = "i3-msg workspace 1"; }
|
||||
{ command = "systemctl --user restart polybar"; always = true; notification = false; }
|
||||
{ command = "feh --bg-center -B \"${bg_colour}\" -z --no-fehbg ${config.xdg.dataFile.wallpapers.source}/flors"; always = true; notification = false; }
|
||||
|
||||
{ command = "feh --bg-center -B \"${bg_colour}\" -z --no-fehbg ${paths.wallpapers}/flors"; always = true; notification = false; }
|
||||
];
|
||||
|
||||
modes = {
|
||||
@@ -99,7 +140,7 @@ in {
|
||||
"Escape" = "mode \"default\"";
|
||||
};
|
||||
|
||||
"${system_mode}" = {
|
||||
"${system_mode}" = {
|
||||
"l" = "exec --no-startup-id ${cfg.locker.command}, mode \"default\"";
|
||||
"e" = "exec --no-startup-id i3-msg exit, mode \"default\"";
|
||||
"s" = "exec --no-startup-id ${cfg.locker.command} && systemctl suspend, mode \"default\"";
|
||||
@@ -163,18 +204,18 @@ in {
|
||||
|
||||
# - Media ------------------------------
|
||||
|
||||
# Pulse Audio controls
|
||||
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"Shift+XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1%";
|
||||
"Shift+XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1%";
|
||||
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
# Pulse Audio controls
|
||||
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"Shift+XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1%";
|
||||
"Shift+XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1%";
|
||||
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
|
||||
# Media player controls
|
||||
"XF86AudioPlay" = "exec playerctl play-pause";
|
||||
"XF86AudioPause" = "exec playerctl play-pause";
|
||||
"XF86AudioNext" = "exec playerctl next";
|
||||
"XF86AudioPrev" = "exec playerctl previous";
|
||||
# Media player controls
|
||||
"XF86AudioPlay" = "exec playerctl play-pause";
|
||||
"XF86AudioPause" = "exec playerctl play-pause";
|
||||
"XF86AudioNext" = "exec playerctl next";
|
||||
"XF86AudioPrev" = "exec playerctl previous";
|
||||
"XF86AudioStop" = "exec playerctl stop";
|
||||
|
||||
# - Workspaces -------------------------
|
||||
@@ -10,6 +10,12 @@ let
|
||||
polybar top &
|
||||
polybar bottom &
|
||||
'';
|
||||
# Paths
|
||||
paths = {
|
||||
config = ../../config/.config/polybar/config.ini;
|
||||
bars = ../../config/.config/polybar/bars;
|
||||
scripts = ../../config/.config/polybar/scripts;
|
||||
};
|
||||
in {
|
||||
|
||||
options.samfelag.modules.desktop.polybar = {
|
||||
@@ -20,19 +26,19 @@ in {
|
||||
|
||||
# - Configuration ----------------------------
|
||||
|
||||
home.packages = [
|
||||
environment.systemPackages = [
|
||||
polybar_pkg
|
||||
];
|
||||
|
||||
xdg.configFile."polybar/config.ini".source = ../../../config/.config/polybar/config.ini;
|
||||
xdg.configFile."polybar/bars".source = ../../../config/.config/polybar/bars;
|
||||
xdg.configFile."polybar/scripts".source = ../../../config/.config/polybar/scripts;
|
||||
hm.xdg.configFile."polybar/config.ini".source = paths.config;
|
||||
hm.xdg.configFile."polybar/bars".source = paths.bars;
|
||||
hm.xdg.configFile."polybar/scripts".source = paths.scripts;
|
||||
|
||||
systemd.user.services.polybar = {
|
||||
hm.systemd.user.services.polybar = {
|
||||
Unit = {
|
||||
Description = "Polybar status bar";
|
||||
PartOf = [ "tray.target" ];
|
||||
X-Restart-Triggers = [ "${config.xdg.configFile."polybar/config.ini".source}" ];
|
||||
X-Restart-Triggers = [ "${paths.config}" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
27
modules/dev/git.nix
Normal file
27
modules/dev/git.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.dev.git;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.dev.git = with lib.types; {
|
||||
enable = lib.mkEnableOption "git";
|
||||
userName = lib.my.mkOpt str config.user.name;
|
||||
userEmail = lib.my.mkOpt (nullOr str) null;
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
];
|
||||
hm.programs.git = {
|
||||
enable = true;
|
||||
|
||||
userName = cfg.userName;
|
||||
userEmail = cfg.userEmail;
|
||||
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -92,20 +92,9 @@ in {
|
||||
|
||||
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
|
||||
|
||||
# env.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ];
|
||||
env.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ];
|
||||
|
||||
environment.sessionVariables = rec {
|
||||
XDG_CACHE_HOME = "$HOME/.cache";
|
||||
XDG_CONFIG_HOME = "$HOME/.config";
|
||||
XDG_BIN_HOME = "$HOME/.local/bin";
|
||||
XDG_DATA_HOME = "$HOME/.local/share";
|
||||
|
||||
PATH = [
|
||||
"$HOME/.config/emacs/bin"
|
||||
];
|
||||
};
|
||||
|
||||
home-manager.users.marc.xdg.configFile."doom".source = ../../../config/doom;
|
||||
home-manager.users.marc.xdg.configFile."doom".source = ../../config/doom;
|
||||
|
||||
system.userActivationScripts = {
|
||||
installDoomEmacs = ''
|
||||
15
modules/gaming/lutris.nix
Normal file
15
modules/gaming/lutris.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.gaming.lutris;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.gaming.lutris = {
|
||||
enable = lib.mkEnableOption "lutris";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
hm.home.packages = with pkgs; [
|
||||
lutris
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.profiles.gaming;
|
||||
cfg = config.samfelag.modules.gaming.steam;
|
||||
in
|
||||
{
|
||||
options.samfelag.profiles.gaming = {
|
||||
|
||||
enable = lib.mkEnableOption "gaming profile";
|
||||
options.samfelag.modules.gaming.steam = {
|
||||
enable = lib.mkEnableOption "steam";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
@@ -6,12 +6,7 @@ with lib.my;
|
||||
options = with types; {
|
||||
user = mkOpt attrs {};
|
||||
|
||||
home = {
|
||||
packages = mkOpt' (listOf package) [] "Packages to be installed at user level";
|
||||
file = mkOpt' attrs {} "Files to place directly in $HOME" ;
|
||||
configFile = mkOpt' attrs {} "Files to place in $XDG_CONFIG_HOME";
|
||||
dataFile = mkOpt' attrs {} "Files to place in $XDG_DATA_HOME";
|
||||
};
|
||||
hm = mkOpt attrs {};
|
||||
|
||||
env = mkOption {
|
||||
# env = { PATH = ["$PATH" ./test]; TEST = "test"; }
|
||||
@@ -36,26 +31,6 @@ with lib.my;
|
||||
uid = 1000;
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
# extraSpecialArgs = { inherit inputs; };
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
users.${config.user.name} = {
|
||||
home = {
|
||||
file = mkAliasDefinitions options.home.file;
|
||||
packages = mkAliasDefinitions options.home.packages;
|
||||
# Necessary for home-manager to work with flakes, otherwise it will
|
||||
# look for a nixpkgs channel.
|
||||
stateVersion = config.system.stateVersion;
|
||||
};
|
||||
xdg = {
|
||||
configFile = mkAliasDefinitions options.home.configFile;
|
||||
dataFile = mkAliasDefinitions options.home.dataFile;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users.users.${config.user.name} = mkAliasDefinitions options.user;
|
||||
|
||||
nix.settings = let users = [ "root" config.user.name ]; in {
|
||||
@@ -63,6 +38,16 @@ with lib.my;
|
||||
allowed-users = users;
|
||||
};
|
||||
|
||||
hm.home.stateVersion = config.system.stateVersion;
|
||||
|
||||
home-manager = {
|
||||
# extraSpecialArgs = { inherit inputs; };
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
users.${config.user.name} = mkAliasDefinitions options.hm;
|
||||
};
|
||||
|
||||
env.PATH = [ "$PATH" ];
|
||||
|
||||
environment.extraInit =
|
||||
|
||||
22
modules/shell/utils.nix
Normal file
22
modules/shell/utils.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.shell.utils;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.shell.utils = {
|
||||
enable = lib.mkEnableOption "Basic shell utils";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
bat
|
||||
exa
|
||||
fd
|
||||
fzf
|
||||
jq
|
||||
ripgrep
|
||||
tldr
|
||||
];
|
||||
hm.xdg.configFile."shell".source = ../../config/.config/shell;
|
||||
};
|
||||
}
|
||||
@@ -1,23 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.modules.shell.zsh;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.shell.zsh = {
|
||||
enable = mkEnableOption "zsh configuration";
|
||||
enable = lib.mkEnableOption "zsh";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
zsh
|
||||
zsh-powerlevel10k
|
||||
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
||||
];
|
||||
|
||||
programs.zsh = {
|
||||
hm.programs.zsh = {
|
||||
enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
|
||||
@@ -64,7 +62,7 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
xdg.configFile."zsh/.p10k.zsh".source = ../../../config/.config/zsh/.p10k.zsh;
|
||||
hm.xdg.configFile."zsh/.p10k.zsh".source = ../../config/.config/zsh/.p10k.zsh;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,17 +1,14 @@
|
||||
{ config, lib, pkgs, self, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.bluetooth;
|
||||
cfg = config.samfelag.modules.system.bluetooth;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.bluetooth = {
|
||||
options.samfelag.modules.system.bluetooth = {
|
||||
enable = lib.mkEnableOption "bluetooth";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
services.blueman.enable = true;
|
||||
|
||||
};
|
||||
}
|
||||
15
modules/system/tailscale.nix
Normal file
15
modules/system/tailscale.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.system.tailscale;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.system.tailscale = {
|
||||
enable = lib.mkEnableOption "tailscale";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
# See https://github.com/tailscale/tailscale/issues/4432
|
||||
networking.firewall.checkReversePath = "loose";
|
||||
services.tailscale.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
# - Basic --------------------------------------
|
||||
|
||||
networking.hostName = "kopavogur";
|
||||
|
||||
# samfelag.modules.user = {
|
||||
# name = "marc";
|
||||
# };
|
||||
|
||||
# - Bootloader ---------------------------------
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.loader.grub.useOSProber = true;
|
||||
|
||||
# - Services -----------------------------------
|
||||
|
||||
samfelag.profiles.desktop.enable = true;
|
||||
|
||||
system.stateVersion = "22.05";
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./nvidia.nix
|
||||
];
|
||||
|
||||
# - Basic --------------------------------------
|
||||
|
||||
user.name = "marc";
|
||||
networking.hostName = "reykjavik";
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
# - Modules ------------------------------------
|
||||
|
||||
samfelag.modules = {
|
||||
# user.name = "marc";
|
||||
bluetooth.enable = true;
|
||||
editors.emacs.enable = true;
|
||||
};
|
||||
|
||||
|
||||
# - Profiles -----------------------------------
|
||||
|
||||
samfelag.profiles = {
|
||||
desktop = {
|
||||
enable = true;
|
||||
laptop = true;
|
||||
};
|
||||
gaming.enable = true;
|
||||
};
|
||||
|
||||
system.stateVersion = "22.05";
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./editors
|
||||
./bluetooth.nix
|
||||
./tailscale.nix
|
||||
];
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./emacs.nix
|
||||
];
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{ config, lib, pkgs, self, ... }:
|
||||
|
||||
let
|
||||
cfg = config.samfelag.modules.tailscale;
|
||||
in
|
||||
{
|
||||
options.samfelag.modules.tailscale = {
|
||||
enable = lib.mkEnableOption "tailscale";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./common.nix
|
||||
./desktop.nix
|
||||
./gaming.nix
|
||||
];
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.samfelag.profiles.desktop;
|
||||
in
|
||||
{
|
||||
options.samfelag.profiles.desktop = {
|
||||
|
||||
enable = mkEnableOption "desktop profile";
|
||||
|
||||
laptop = mkOption {
|
||||
description = "Enable features for a laptop (trackpad, battery, etc...)";
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# - Packages ---------------------------------
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
pamixer
|
||||
i3lock-blur
|
||||
];
|
||||
|
||||
samfelag.modules.app.alacritty.enable = true;
|
||||
|
||||
# - Audio ------------------------------------
|
||||
|
||||
sound.enable = true;
|
||||
|
||||
hardware = {
|
||||
pulseaudio = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
package = pkgs.pulseaudioFull;
|
||||
};
|
||||
};
|
||||
|
||||
# - Window + Display Manager -----------------
|
||||
|
||||
environment.pathsToLink = [ "/libexec" ];
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
||||
libinput = mkIf cfg.laptop {
|
||||
enable = true;
|
||||
touchpad.tapping = true;
|
||||
};
|
||||
|
||||
desktopManager = {
|
||||
xterm.enable = false;
|
||||
};
|
||||
|
||||
displayManager = {
|
||||
defaultSession = "none+i3";
|
||||
lightdm = {
|
||||
enable = true;
|
||||
greeters.mini = {
|
||||
enable = true;
|
||||
user = "marc";
|
||||
extraConfig = ''
|
||||
[greeter]
|
||||
show-sys-info = true
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
windowManager.i3.enable = true;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user