restructure with nixos modules

This commit is contained in:
Pim Kunis 2023-10-08 11:44:31 +02:00
parent 159f5dfe75
commit 1f1c30f57c
19 changed files with 235 additions and 182 deletions

8
alacritty/default.nix Normal file
View file

@ -0,0 +1,8 @@
{
config = {
programs.alacritty = {
enable = true;
settings = import ./config.nix;
};
};
}

19
bash/default.nix Normal file
View file

@ -0,0 +1,19 @@
{
config = {
programs.bash = {
enable = true;
shellAliases = {
htop = "btop";
gp = "git push";
gco = "git checkout";
gd = "git diff";
gc = "git commit";
gpl = "git pull";
gb = "git branch";
ga = "git add";
gl = "git log";
gs = "git status";
};
};
};
}

9
direnv/default.nix Normal file
View file

@ -0,0 +1,9 @@
{
config = {
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
};
}

View file

@ -1,7 +1,7 @@
{nurpkgs, lib, ...}@args: {nurpkgs, lib, ...}@args:
let let
rycee-addons = nurpkgs.repos.rycee.firefox-addons; rycee-addons = nurpkgs.repos.rycee.firefox-addons;
own-addons = import ./derivations.nix args; custom-addons = import ./custom-addons.nix args;
in in
{ {
default = lib.concatLists [ default = lib.concatLists [
@ -18,7 +18,7 @@ in
boring-rss boring-rss
# rycee.bypass-paywalls-clean # rycee.bypass-paywalls-clean
]) ])
(with own-addons; [ (with custom-addons; [
http-version-indicator http-version-indicator
indicatetls indicatetls
sixindicator sixindicator
@ -28,6 +28,6 @@ in
ublock-origin ublock-origin
istilldontcareaboutcookies istilldontcareaboutcookies
keepassxc-browser keepassxc-browser
own-addons.simple-style-fox-2 custom-addons.simple-style-fox-2
]; ];
} }

51
firefox/default.nix Normal file
View file

@ -0,0 +1,51 @@
{ pkgs, ...}@args:
let
nurpkgs = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { inherit pkgs; };
firefoxAddons = import ./addons.nix (args // {inherit nurpkgs; });
firefoxSettings = {
"browser.aboutConfig.showWarning" = false;
"browser.toolbars.bookmarks.visibility" = "always";
"browser.tabs.firefox-view" = false;
"browser.shell.checkDefaultBrowser" = false;
};
in
{
config = {
programs.firefox = {
enable = true;
profiles = {
default = {
id = 0;
isDefault = true;
settings = firefoxSettings;
extensions = firefoxAddons.default;
};
sue = {
id = 1;
settings = firefoxSettings;
extensions = firefoxAddons.sue;
};
};
};
xdg.desktopEntries.firefox-sue = {
categories = [ "Network" "WebBrowser" ];
exec = "firefox -P sue --name firefox %U";
genericName = "Web Browser";
icon = "firefox";
mimeType = [
"text/html"
"text/xml"
"application/xhtml+xml"
"application/vnd.mozilla.xul+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
name = "Firefox | Sue";
startupNotify = true;
terminal = false;
type = "Application";
};
};
}

8
fzf/default.nix Normal file
View file

@ -0,0 +1,8 @@
{
config = {
programs.fzf = {
enable = true;
enableBashIntegration = true;
};
};
}

12
git/default.nix Normal file
View file

@ -0,0 +1,12 @@
{
config = {
programs.git = {
enable = true;
userName = "Pim Kunis";
userEmail = "pim@kunis.nl";
extraConfig = {
push.autoSetupRemote = true;
};
};
};
}

197
home.nix
View file

@ -1,24 +1,26 @@
{ pkgs, lib, ... }@args: { pkgs, ... }:
let
nurpkgs = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { inherit pkgs; };
firefox-addons = import ./firefox-addons (args // {inherit nurpkgs; });
homeDirectory = "/home/pim";
firefoxSettings = {
"browser.aboutConfig.showWarning" = false;
"browser.toolbars.bookmarks.visibility" = "always";
"browser.tabs.firefox-view" = false;
"browser.shell.checkDefaultBrowser" = false;
};
in
{ {
imports = [
./bash
./neovim
./firefox
./ssh
./syncthing
./alacritty
./keepassxc
./git
./direnv
./thunderbird
./fzf
];
home = { home = {
username = "pim"; username = "pim";
homeDirectory = homeDirectory; homeDirectory = "/home/pim";
stateVersion = "23.05"; stateVersion = "23.05";
packages = with pkgs; [ packages = with pkgs; [
keepassxc
nil
moonlight-qt moonlight-qt
vlc vlc
nicotine-plus nicotine-plus
@ -29,146 +31,12 @@ in
tree tree
gimp gimp
libreoffice libreoffice
nodePackages.pyright
neofetch
gopls
]; ];
}; };
services = {
syncthing.enable = true;
};
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
chromium.enable = true; chromium.enable = true;
neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins; [
nvim-lspconfig
gruvbox-nvim
leap-nvim
telescope-nvim
vim-commentary
vim-sleuth
gitsigns-nvim
nvim-cmp
cmp-nvim-lsp
friendly-snippets
neodev-nvim
];
extraLuaConfig = builtins.readFile ./neovim.lua;
};
alacritty = {
enable = true;
settings = import ./alacritty.nix;
};
firefox = {
enable = true;
profiles = {
default = {
id = 0;
isDefault = true;
settings = firefoxSettings;
extensions = firefox-addons.default;
};
sue = {
id = 1;
settings = firefoxSettings;
extensions = firefox-addons.sue;
};
};
};
bash = {
enable = true;
shellAliases = {
htop = "btop";
gp = "git push";
gco = "git checkout";
gd = "git diff";
gc = "git commit";
gpl = "git pull";
gb = "git branch";
ga = "git add";
gl = "git log";
gs = "git status";
};
};
direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
git = {
enable = true;
userName = "Pim Kunis";
userEmail = "pim@kunis.nl";
extraConfig = {
core.editor = "nvim";
push.autoSetupRemote = true;
};
};
fzf = {
enable = true;
enableBashIntegration = true;
};
ssh = {
enable = true;
extraConfig = "User root";
matchBlocks = {
gitlab-sue = lib.hm.dag.entryBefore [ "*" ] {
hostname = "gitlab.com";
identityFile = "~/.ssh/sue_ed25519";
identitiesOnly = true;
};
github = lib.hm.dag.entryBefore [ "*" ] {
hostname = "github.com";
user = "pizzapim";
identitiesOnly = true;
};
lewis = lib.hm.dag.entryBefore [ "*" ] {
hostname = "lewis.hyp";
};
atlas = lib.hm.dag.entryBefore [ "*" ] {
hostname = "atlas.hyp";
};
jefke = lib.hm.dag.entryBefore [ "*" ] {
hostname = "jefke.hyp";
};
hermes = lib.hm.dag.entryBefore [ "*" ] {
hostname = "hermes.dmz";
};
maestro = lib.hm.dag.entryBefore [ "*" ] {
hostname = "maestro.dmz";
};
bancomart = lib.hm.dag.entryBefore [ "*" ] {
hostname = "bancomart.dmz";
};
handjecontantje = lib.hm.dag.entryBefore [ "*" ] {
hostname = "handjecontantje.dmz";
};
};
};
thunderbird = {
enable = true;
profiles.default = {
isDefault = true;
};
};
}; };
# Let home-manager manage the X session # Let home-manager manage the X session
@ -176,34 +44,5 @@ in
enable = true; enable = true;
}; };
xdg = { xdg.userDirs.enable = true;
configFile = {
"keepassxc/keepassxc.ini".text = lib.generators.toINI {} (import ./keepassxc.nix);
"syncthing/config.xml".source = ./syncthing.xml;
};
userDirs = {
enable = true;
music = "${homeDirectory}/sync/Music";
};
desktopEntries.firefox-sue = {
categories = [ "Network" "WebBrowser" ];
exec = "firefox -P sue --name firefox %U";
genericName = "Web Browser";
icon = "firefox";
mimeType = [
"text/html"
"text/xml"
"application/xhtml+xml"
"application/vnd.mozilla.xul+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
name = "Firefox | Sue";
startupNotify = true;
terminal = false;
type = "Application";
};
};
} }

8
keepassxc/default.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs, lib, ...}:
{
config = {
home.packages = [ pkgs.keepassxc ];
xdg.configFile."keepassxc/keepassxc.ini".text = lib.generators.toINI {} (import ./config.nix);
};
}

36
neovim/default.nix Normal file
View file

@ -0,0 +1,36 @@
{ pkgs, ... }:
{
config = {
home.packages = with pkgs; [
nil
nodePackages.pyright
neofetch
gopls
];
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins; [
nvim-lspconfig
gruvbox-nvim
leap-nvim
telescope-nvim
vim-commentary
vim-sleuth
gitsigns-nvim
nvim-cmp
cmp-nvim-lsp
friendly-snippets
neodev-nvim
];
extraLuaConfig = builtins.readFile ./neovim.lua;
};
programs.git.extraConfig.core.editor = "nvim";
};
}

44
ssh/default.nix Normal file
View file

@ -0,0 +1,44 @@
{ lib, ...}:
{
config = {
programs.ssh = {
enable = true;
extraConfig = "User root";
matchBlocks = {
gitlab-sue = lib.hm.dag.entryBefore [ "*" ] {
hostname = "gitlab.com";
identityFile = "~/.ssh/sue_ed25519";
identitiesOnly = true;
};
github = lib.hm.dag.entryBefore [ "*" ] {
hostname = "github.com";
user = "pizzapim";
identitiesOnly = true;
};
lewis = lib.hm.dag.entryBefore [ "*" ] {
hostname = "lewis.hyp";
};
atlas = lib.hm.dag.entryBefore [ "*" ] {
hostname = "atlas.hyp";
};
jefke = lib.hm.dag.entryBefore [ "*" ] {
hostname = "jefke.hyp";
};
hermes = lib.hm.dag.entryBefore [ "*" ] {
hostname = "hermes.dmz";
};
maestro = lib.hm.dag.entryBefore [ "*" ] {
hostname = "maestro.dmz";
};
bancomart = lib.hm.dag.entryBefore [ "*" ] {
hostname = "bancomart.dmz";
};
handjecontantje = lib.hm.dag.entryBefore [ "*" ] {
hostname = "handjecontantje.dmz";
};
};
};
};
}

9
syncthing/default.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, ... }:
{
config = {
services.syncthing.enable = true;
xdg.configFile."syncthing/config.xml".source = ./syncthing.xml;
xdg.userDirs.music = "${config.home.homeDirectory}/sync/Music";
};
}

10
thunderbird/default.nix Normal file
View file

@ -0,0 +1,10 @@
{
config = {
programs.thunderbird = {
enable = true;
profiles.default = {
isDefault = true;
};
};
};
}