1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/configs/default.nix

303 lines
8.8 KiB
Nix
Raw Normal View History

2019-11-05 21:59:51 +01:00
{ pkgs, lib, config, options, ... }:
2019-09-14 18:42:18 +02:00
let
inherit (lib.strings) makeBinPath;
in
2019-04-19 15:02:05 +02:00
{
2019-04-19 03:11:51 +02:00
imports = [
2019-10-26 13:43:30 +02:00
<niveum/modules/constants.nix>
2019-04-19 03:11:51 +02:00
<home-manager/nixos>
2019-10-26 13:43:30 +02:00
# ./mopidy.nix
./alacritty.nix
./bash.nix
./bluetooth.nix
./chromium.nix
./cloud.nix
./compton.nix
./default.nix
./direnv.nix
# ./home-assistant.nix
./distrobump.nix
./docker.nix
./dunst.nix
./fonts.nix
./git.nix
./hledger.nix
./htop.nix
./hu-berlin.nix
./i3.nix
./kdeconnect.nix
./keybase.nix
./keyboard.nix
./mail.nix
./mpv.nix
./nano.nix
./neovim.nix
# ./newsboat.nix (broken)
./nixpkgs-unstable.nix
./packages
./printing.nix
./random-background.nix
./redshift.nix
./retiolum.nix
./rofi.nix
./sncli.nix
./ssh.nix
./sudo.nix
./themes/mac-os.nix
./theming.nix
./tmux.nix
./todo-txt.nix
./traadfri.nix
./unclutter.nix
# ./urxvt.nix
./vscode.nix
./xautolock.nix
# ./xresources.nix
./zsh.nix
2019-04-19 03:11:51 +02:00
{
niveum.user = {
github = "kmein";
email = "kieran.meinhardt@gmail.com";
name = "Kierán Meinhardt";
};
niveum.applications = rec {
2019-04-19 15:02:05 +02:00
fileManager = "${config.niveum.applications.terminal} -e ${pkgs.ranger}/bin/ranger";
2019-04-19 03:11:51 +02:00
};
niveum.theme = {
gtk = { name = "Arc"; package = pkgs.arc-theme; };
icon = { name = "Arc"; package = pkgs.arc-icon-theme; };
cursor = { name = "capitaine-cursors"; package = pkgs.capitaine-cursors; };
};
}
2019-10-26 13:29:53 +02:00
{
2019-11-05 21:59:51 +01:00
nix.nixPath = options.nix.nixPath.default ++ [
"/var/src"
"nixpkgs-overlays=${toString ../overlays}"
];
2019-10-26 13:29:53 +02:00
}
2019-04-19 03:11:51 +02:00
{
2019-11-05 21:59:51 +01:00
services.dbus.packages = [ pkgs.gnome3.dconf ];
}
{
nixpkgs = {
config.allowUnfree = true;
overlays = [
# (import <stockholm/submodules/nix-writers>)
(import <niveum/overlays/toml.nix>)
2019-11-09 16:33:59 +01:00
(import <niveum/overlays/scripts.nix>)
2019-11-05 21:59:51 +01:00
(self: super: {
python3Packages = super.python3Packages.override {
overrides = new: old: {
spotify-cli-linux = new.callPackage <niveum/packages/spotify-cli-linux.nix> {};
instaloader = new.callPackage <niveum/packages/instaloader.nix> {};
sncli = new.callPackage <niveum/packages/sncli.nix> {};
};
2019-05-15 23:42:37 +02:00
};
2019-08-25 22:41:36 +02:00
2019-11-05 21:59:51 +01:00
writeDashBin = super.writers.writeDashBin;
writeDash = super.writers.writeDash;
2019-08-18 11:17:28 +02:00
2019-11-05 21:59:51 +01:00
iolanguage = super.callPackage <niveum/packages/iolanguage.nix> {};
nix-git = super.callPackage <niveum/packages/nix-git.nix> {};
gfs-fonts = super.callPackage <niveum/packages/gfs-fonts.nix> {};
2019-11-09 16:33:59 +01:00
fzf-wrappers = super.callPackage <niveum/packages/fzf-wrappers.nix> {};
2019-11-05 21:59:51 +01:00
})
];
2019-04-19 03:11:51 +02:00
};
}
{
boot.cleanTmpDir = true;
boot.loader.timeout = 1;
boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ];
}
{
time.timeZone = "Europe/Berlin";
2019-10-11 21:12:32 +02:00
location = {
latitude = 52.517;
longitude = 13.3872;
};
2019-04-19 03:11:51 +02:00
}
{
home-manager.users.me = {
programs.zathura = {
enable = true;
options.selection-clipboard = "clipboard";
};
};
}
{
users.mutableUsers = false;
2019-08-26 17:27:09 +02:00
users.defaultUserShell = pkgs.zsh;
2019-04-19 03:11:51 +02:00
users.users.me = {
name = "kfm";
2019-05-14 07:18:04 +02:00
description = config.niveum.user.name;
2019-04-19 03:11:51 +02:00
hashedPassword = "$6$w9hXyGFl/.IZBXk$5OiWzS1G.5hImhh1YQmZiCXYNAJhi3X6Y3uSLupJNYYXPLMsQpx2fwF4Xr2uYzGMV8Foqh8TgUavx1APD9rcb/";
2019-08-26 17:27:09 +02:00
isNormalUser = true;
2019-04-19 03:11:51 +02:00
};
}
{
sound.enable = true;
hardware.pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull; # for bluetooth sound output
};
users.users.me.extraGroups = [ "audio" ];
environment.systemPackages = [ pkgs.pavucontrol pkgs.pamixer ];
}
2019-04-22 22:40:41 +02:00
{
environment.systemPackages =
let niveumPath = "${config.users.users.me.home}/prog/git/niveum";
in [
2019-07-03 22:12:40 +02:00
(pkgs.writers.writeDashBin "niveum-deploy" ''
[ $# -eq 1 ] || echo >&2 "Usage: niveum-deploy SYSTEM"
2019-04-22 22:40:41 +02:00
eval $(${pkgs.nix}/bin/nix-build --no-out-link "${niveumPath}/deploy.nix" -A "$1")
2019-04-22 22:40:41 +02:00
'')
2019-07-03 22:12:40 +02:00
(pkgs.writers.writeDashBin "niveum-update" ''
${pkgs.nix-prefetch-git}/bin/nix-prefetch-git \
--url https://github.com/NixOS/nixpkgs-channels \
--rev refs/heads/nixos-${config.system.stateVersion} \
> "${niveumPath}/nixpkgs.json"
2019-04-22 22:40:41 +02:00
'')
];
}
2019-04-19 03:11:51 +02:00
{
2019-05-15 23:42:37 +02:00
environment.interactiveShellInit = "export PATH=$PATH:$HOME/.cargo/bin";
2019-08-22 09:44:11 +02:00
environment.shellAliases =
let
wcd = pkgs.writers.writeDash "wcd" ''
cd "$(readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname)/.."
2019-08-23 18:27:06 +02:00
'';
where = pkgs.writers.writeDash "where" ''
readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname
2019-08-23 18:27:06 +02:00
'';
take = pkgs.writers.writeDash "take" ''
2019-08-23 18:27:06 +02:00
mkdir "$1" && cd "$1"
'';
2019-08-22 09:44:11 +02:00
in {
"ix.io" = "${pkgs.curl}/bin/curl -F 'f:1=<-' ix.io";
cat = "${pkgs.bat}/bin/bat --style=plain";
2019-09-24 23:17:03 +02:00
chromium-incognito = "chromium --user-data-dir=$(mktemp -d /tmp/chr.XXXXXX) --no-first-run --incognito";
2019-10-01 20:49:07 +02:00
pbcopy = "${pkgs.xclip}/bin/xclip -selection clipboard -in";
pbpaste = "${pkgs.xclip}/bin/xclip -selection clipboard -out";
2019-04-19 03:11:51 +02:00
cp = "cp -i";
dig = "dig +short";
ip = "${pkgs.iproute}/bin/ip -c";
2019-09-14 20:26:07 +02:00
l = "${pkgs.exa}/bin/exa -s type -a";
la = "${pkgs.exa}/bin/exa -s type -la";
ll = "${pkgs.exa}/bin/exa -s type -l";
ls = "${pkgs.exa}/bin/exa -s type";
mv = "mv -i";
2019-11-05 21:59:51 +01:00
nixi = "nix repl '<nixpkgs>'";
ns = "nix-shell --run zsh";
o = "${pkgs.xdg_utils}/bin/xdg-open";
rm = "rm -i";
2019-08-23 18:27:06 +02:00
take = "source ${take}";
tmux = "${pkgs.tmux}/bin/tmux -2";
2019-08-27 17:27:26 +02:00
tree = "${pkgs.exa}/bin/exa --tree";
wcd = "source ${wcd}";
weechat = "${pkgs.openssh}/bin/ssh kmein@prism.r -t tmux attach";
where = "source ${where}";
2019-04-19 03:11:51 +02:00
};
}
{
networking.wireless = {
enable = true;
userControlled.enable = true;
networks = {
2019-09-25 18:36:57 +02:00
"Aether" = {
pskRaw = "e1b18af54036c5c9a747fe681c6a694636d60a5f8450f7dec0d76bc93e2ec85a";
priority = 10;
};
"Asoziales Netzwerk" = {
pskRaw = "8e234041ec5f0cd1b6a14e9adeee9840ed51b2f18856a52137485523e46b0cb6";
priority = 10;
};
"Libertarian WiFi" = {
pskRaw = "e9beaae6ffa55d10e80b8a2e7d997411d676a3cc6f1f29d0b080391f04555050";
priority = 9;
};
2019-08-05 09:37:32 +02:00
"EasyBox-927376".pskRaw = "dbd490ab69b39bd67cfa06daf70fc3ef3ee90f482972a668ed758f90f5577c22";
"FlixBus Wi-Fi" = {};
"FlixBus" = {};
"FlixTrain" = {};
2019-09-25 18:36:57 +02:00
"BVG Wi-Fi" = {};
2019-08-05 09:37:32 +02:00
"Ni/Schukajlow".pskRaw = "ffc47f6829da59c48aea878a32252223303f5c47a3859edc90971ffc63346781";
"WIFIonICE" = {};
2019-05-14 07:18:04 +02:00
"WLAN-914742".psk = "67647139648174545446";
2019-08-11 00:08:28 +02:00
"WLAN-XVMU6T".pskRaw = "46ea807283255a3d7029233bd79c18837df582666c007c86a8d591f65fae17cc";
2019-08-05 09:37:32 +02:00
"c-base-public" = {};
"discord".psk = "baraustrinken";
"security-by-obscurity".psk = "44629828256481964386";
2019-09-24 16:47:53 +02:00
"Mayflower".psk = "Fr31EsLan";
2019-04-19 03:11:51 +02:00
};
};
environment.systemPackages = [ pkgs.wpa_supplicant_gui ];
}
{
networking.hosts = {
"192.168.178.1" = [ "fritz.box" ];
"192.168.178.21" = [ "scardanelli" ];
"192.168.178.22" = [ "homeros" ];
"192.168.178.24" = [ "catullus" ];
};
}
{
i18n.defaultLocale = "en_GB.UTF-8";
}
{
services.illum.enable = true;
}
{
services.xserver = {
enable = true;
2019-05-02 15:28:17 +02:00
displayManager.lightdm = {
2019-04-19 03:11:51 +02:00
enable = true;
2019-09-14 18:43:23 +02:00
autoLogin = {
enable = true;
user = config.users.users.me.name;
};
2019-05-02 15:28:17 +02:00
greeters.gtk = {
enable = true;
indicators = [ "~spacer" "~host" "~spacer" "~session" "~power" ];
};
2019-04-19 03:11:51 +02:00
};
2019-05-02 15:28:17 +02:00
desktopManager.default = "none";
2019-04-19 03:11:51 +02:00
};
}
{
security.wrappers = {
pmount.source = "${pkgs.pmount}/bin/pmount";
pumount.source = "${pkgs.pmount}/bin/pumount";
};
}
{
programs.command-not-found.enable = true;
}
2019-08-22 09:44:21 +02:00
{
systemd.services.restart-vpn = {
description = "Restart VPNs after suspend";
wantedBy = [ "suspend.target" ];
after = [ "suspend.target" ];
serviceConfig.Type = "oneshot";
script = ''
set -efu
2019-09-14 18:42:18 +02:00
export PATH=${makeBinPath [ pkgs.procps ]}
pkill -HUP --exact openvpn
pkill -ALRM --exact tincd
2019-08-22 09:44:21 +02:00
'';
};
}
2019-04-19 03:11:51 +02:00
];
}