ark/users/patriot/default.nix

373 lines
11 KiB
Nix
Raw Normal View History

2022-02-18 20:31:01 +03:00
{
pkgs,
lib,
2022-04-09 22:01:44 +03:00
tlib,
2022-02-18 20:31:01 +03:00
...
2022-04-09 21:33:13 +03:00
} @ globalAttrs: let
2021-05-03 07:48:31 +03:00
inherit (lib) mapAttrs' nameValuePair;
inherit (builtins) readDir fetchGit;
2022-04-09 21:33:13 +03:00
2022-04-09 22:01:44 +03:00
pkgBin = tlib.pkgBin pkgs;
2022-04-09 21:33:13 +03:00
nixosConfig = globalAttrs.config;
2022-02-18 20:31:01 +03:00
in {
2020-11-21 23:54:07 +03:00
users.users.patriot = {
isNormalUser = true;
createHome = true;
home = "/home/patriot";
2022-02-18 20:31:01 +03:00
extraGroups = [
"wheel"
"adbusers"
"dialout"
];
2020-11-21 23:54:07 +03:00
shell = pkgs.zsh;
2022-03-09 23:55:02 +03:00
hashedPassword = "$6$spzqhAyJfhHy$iHgLBlhjGn1l8PnbjJdWTn1GPvcjMqYNKUzdCe/7IrX6sHNgETSr/Nfpdmq9FCXLhrAfwHOd/q/8SvfeIeNX4/";
2020-11-21 23:54:07 +03:00
};
2021-08-23 21:25:02 +03:00
environment = {
2022-02-18 20:31:01 +03:00
systemPackages = [pkgs.qt5.qtwayland];
shells = with pkgs; [bashInteractive zsh];
2021-08-23 21:25:02 +03:00
};
2020-11-21 23:54:07 +03:00
xdg.portal = {
enable = true;
gtkUsePortal = true;
2022-02-18 20:31:01 +03:00
extraPortals = with pkgs; [xdg-desktop-portal xdg-desktop-portal-wlr];
2020-11-21 23:54:07 +03:00
};
programs = {
adb.enable = true;
steam.enable = true;
};
2021-12-25 16:19:03 +03:00
security = {
pam.services.patriot = {
enableGnomeKeyring = true;
enableKwallet = false;
};
sudo.extraRules = [
{
2022-02-18 20:31:01 +03:00
users = ["patriot"];
commands = [
{
command = "${pkgs.profile-sync-daemon}/bin/psd-overlay-helper";
options = ["SETENV" "NOPASSWD"];
}
];
2021-12-25 16:19:03 +03:00
}
];
};
2021-01-17 18:34:34 +03:00
services = {
2021-12-25 16:19:03 +03:00
psd.enable = true;
2021-05-14 01:35:10 +03:00
gnome = {
2021-01-17 18:34:34 +03:00
gnome-keyring.enable = true;
2021-12-25 16:19:03 +03:00
core-utilities.enable = false;
tracker-miners.enable = false;
tracker.enable = false;
2021-01-17 18:34:34 +03:00
};
2021-03-18 17:12:44 +03:00
xserver = {
2021-01-17 17:25:54 +03:00
enable = true;
desktopManager = {
2022-04-22 00:16:12 +03:00
gnome.enable = true;
xterm.enable = false;
};
displayManager = {
autoLogin = {
2022-04-24 03:44:42 +03:00
enable = false;
user = "patriot";
};
gdm = {
2022-04-22 00:16:12 +03:00
enable = true;
wayland = true;
};
2022-04-22 00:16:12 +03:00
startx.enable = false;
};
2021-03-18 17:12:44 +03:00
};
};
systemd = {
2022-04-10 05:48:34 +03:00
targets.network-online.enable = false;
services = {
systemd-networkd-wait-online.enable = false;
NetworkManager-wait-online.enable = false;
2021-01-17 17:25:54 +03:00
};
};
2022-03-09 23:55:02 +03:00
home-manager.users.patriot = {
config,
pkgs,
...
}: let
personal = import ../../personal.nix;
name = personal.name;
email = personal.emails.primary;
2022-04-22 07:40:28 +03:00
font = {
name = "Comic Mono";
size = 13;
package = let
ttf = pkgs.fetchurl {
url = "https://dtinth.github.io/comic-mono-font/ComicMono.ttf";
sha256 = "sha256-O8FCXpIqFqvw7HZ+/+TQJoQ5tMDc6YQy4H0V9drVcZY=";
2022-03-09 23:55:02 +03:00
};
2022-04-22 07:40:28 +03:00
in
pkgs.runCommand "comic-mono" {} ''
mkdir -p $out/share/fonts/truetype
ln -s ${ttf} $out/share/fonts/truetype
'';
2022-03-09 23:55:02 +03:00
};
in {
2022-04-09 18:01:35 +03:00
imports = [
2022-04-09 21:33:13 +03:00
../modules/direnv
../modules/git
../modules/starship
2022-04-09 18:01:35 +03:00
];
2022-04-09 22:01:44 +03:00
fonts.fontconfig.enable = lib.mkForce true;
2022-03-09 23:55:02 +03:00
home = {
homeDirectory = nixosConfig.users.users.patriot.home;
packages = with pkgs; [
# Font stuff
2022-04-22 07:40:28 +03:00
font.package
2022-03-09 23:55:02 +03:00
noto-fonts-cjk
font-awesome
dejavu_fonts
2022-05-03 21:12:47 +03:00
#(nerdfonts.override {fonts = [font.name];})
2022-03-09 23:55:02 +03:00
# Programs
2022-04-22 07:40:28 +03:00
wezterm
2022-03-09 23:55:02 +03:00
cargo-outdated
cargo-release
cargo-udeps
vulkan-tools
krita
gnome3.seahorse
cachix
appimage-run
pfetch
gnupg
imv
mpv
youtube-dl
ffmpeg
mupdf
transmission-qt
2022-04-24 03:44:42 +03:00
lutris
2022-03-09 23:55:02 +03:00
xdg_utils
tagref
hydrus
papirus-icon-theme
wl-clipboard
rust-analyzer
(
lib.hiPrio
2022-05-03 21:12:47 +03:00
(steam.override {
extraLibraries = pkgs: with pkgs; [mimalloc pipewire vulkan-loader wayland wayland-protocols];
})
2022-03-09 23:55:02 +03:00
)
/*
(multimc.overrideAttrs (old: {
src = builtins.fetchGit { url = "https://github.com/AfoninZ/MultiMC5-Cracked.git"; ref = "develop"; rev = "9069e9c9d0b7951c310fdcc8bdc70ebc422a7634"; submodules = true; };
}))
*/
standardnotes
2022-05-03 04:31:30 +03:00
gh
cloudflared
ripcord
2022-03-09 23:55:02 +03:00
];
};
programs = {
2022-04-17 19:20:06 +03:00
firefox = {
enable = true;
};
2022-03-09 23:55:02 +03:00
chromium = {
enable = true;
package = pkgs.chromium;
extensions = [
"gcbommkclmclpchllfjekcdonpmejbdp"
# https everywhere
"cjpalhdlnbpafiamejdnhcphjbkeiagm"
# ublock
"nngceckbapebfimnlniiiahkandclblb"
# bitwarden
"ldpochfccmkkmhdbclfhpagapcfdljkj"
# decentraleyes
"annfbnbieaamhaimclajlajpijgkdblo"
# dark theme
"eimadpbcbfnmbkopoojfekhnkhdbieeh"
# dark reader
"hlepfoohegkhhmjieoechaddaejaokhf"
# github refined
"pmcmeagblkinmogikoikkdjiligflglb"
# privacy redirect
];
};
git = {
signing = {
key = "E1C119F91F4CAE53E8445CAFBB57FCE7E35984F6";
signByDefault = true;
2021-05-03 07:48:31 +03:00
};
2022-03-09 23:55:02 +03:00
userName = name;
userEmail = email;
};
ssh = {
enable = true;
compression = true;
hashKnownHosts = true;
userKnownHostsFile = "~/.local/share/ssh/known-hosts";
# Only needed for darcs hub
# extraConfig = ''
# Host hub.darcs.net
# ControlMaster no
# ForwardAgent no
# ForwardX11 no
# Ciphers +aes256-cbc
# MACs +hmac-sha1
# '';
};
zsh = {
enable = true;
autocd = true;
enableVteIntegration = true;
enableAutosuggestions = true;
enableCompletion = true;
plugins = let
fast-syntax-highlighting = let
name = "fast-syntax-highlighting";
in {
inherit name;
src = pkgs."zsh-${name}".out;
};
per-directory-history = {
name = "per-directory-history";
src =
pkgs.fetchFromGitHub
{
owner = "jimhester";
repo = "per-directory-history";
rev = "d2e291dd6434e340d9be0e15e1f5b94f32771c06";
hash = "sha256-VHRgrVCqzILqOes8VXGjSgLek38BFs9eijmp0JHtD5Q=";
2021-05-03 07:48:31 +03:00
};
2022-03-09 23:55:02 +03:00
};
in [fast-syntax-highlighting per-directory-history];
# xdg compliant
dotDir = ".config/zsh";
history.path = ".local/share/zsh/history";
initExtra = ''
export TERM=alacritty
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
2021-05-03 07:48:31 +03:00
2022-03-09 23:55:02 +03:00
function tomp4 () {
2022-04-10 05:48:34 +03:00
${pkgBin "ffmpeg"} -i $1 -c:v libx264 -preset slow -crf 30 -c:a aac -b:a 128k "$1.mp4"
2022-03-09 23:55:02 +03:00
}
2021-05-03 07:48:31 +03:00
2022-03-09 23:55:02 +03:00
function topng () {
2022-04-10 05:48:34 +03:00
${pkgBin "ffmpeg"} -i $1 "$1.png"
2022-03-09 23:55:02 +03:00
}
2021-05-03 07:48:31 +03:00
2022-03-09 23:55:02 +03:00
bindkey "$terminfo[kRIT5]" forward-word
bindkey "$terminfo[kLFT5]" backward-word
zstyle ':completion:*' menu select
2021-05-03 07:48:31 +03:00
2022-03-09 23:55:02 +03:00
eval "$(zoxide init zsh)"
'';
shellAliases =
nixosConfig.environment.shellAliases
// {
harmony-ssh = ''
2022-04-10 05:48:34 +03:00
${pkgBin "mosh"} root@chat.harmonyapp.io
2021-06-05 09:13:41 +03:00
'';
2021-05-03 07:48:31 +03:00
};
2022-03-09 23:55:02 +03:00
};
fzf.enable = true;
vscode = {
enable = true;
package = pkgs.vscode;
extensions = let
mkExt = n: v: p: s: {
name = n;
version = v;
publisher = p;
sha256 = s;
};
in
(
pkgs.vscode-utils.extensionsFromVscodeMarketplace
[
# Rust
(mkExt "rust-analyzer" "0.3.968" "matklad" "sha256-wuNdmUYburGjgri8gFJl1FSryJbz1aXjJy4NQ+/Wbk4=")
(mkExt "even-better-toml" "0.14.2" "tamasfe" "sha256-lE2t+KUfClD/xjpvexTJlEr7Kufo+22DUM9Ju4Tisp0=")
(mkExt "crates" "0.5.10" "serayuzgur" "sha256-bY/dphiEPPgTg1zMjvxx4b0Ska2XggRucnZxtbppcLU=")
# Nix
2022-02-18 20:31:01 +03:00
(
2022-03-09 23:55:02 +03:00
mkExt "nix-env-selector" "1.0.7" "arrterian" "sha256-DnaIXJ27bcpOrIp1hm7DcrlIzGSjo4RTJ9fD72ukKlc="
2022-02-18 20:31:01 +03:00
)
2022-03-09 23:55:02 +03:00
# Go
(mkExt "Go" "0.32.0" "golang" "sha256-OsKeZrG157l1HUCDvymJ3ovLxlEEJf7RBe2hXOutdyg=")
# Flutter and dart
(mkExt "flutter" "3.37.20220301" "Dart-Code" "sha256-PS24pbqKNZ/myNcTqgjosG0Pq58yMoATKDgy3k23JlE=")
(mkExt "dart-code" "3.37.20220303" "Dart-Code" "sha256-hS+V4kLe+eGIqj/1mZdgbhxWWxqSr2ZUsc2V0HI6tN8=")
# protobuf
(mkExt "vscode-proto3" "0.5.5" "zxh404" "sha256-Em+w3FyJLXrpVAe9N7zsHRoMcpvl+psmG1new7nA8iE=")
(mkExt "vscode-buf" "0.4.0" "bufbuild" "sha256-VM6LYYak1rB4AdpVYfKpOfizGaFI/R+iUsf6UT50vdw=")
# git
(mkExt "gitlens" "12.0.2" "eamodio" "sha256-et2uam4hOQkxxT+r0fwZhpWGjHk45NAOriFA/43ngpo=")
# Customization
(mkExt "material-icon-theme" "4.14.1" "PKief" "sha256-OHXi0EfeyKMeFiMU5yg0aDoWds4ED0lb+l6T12XZ3LQ=")
(mkExt "horizon-theme-vscode" "1.0.0" "alexandernanberg" "sha256-M7SmOYPkAVi5jQLynZqTjmFo9UcQ6W4dU4euP6ua9Z8=")
]
)
++ (
with pkgs.vscode-extensions; [
a5huynh.vscode-ron
/*
vadimcn.vscode-lldb
*/
jnoortheen.nix-ide
]
);
userSettings = {
"workbench.iconTheme" = "material-icon-theme";
"workbench.colorTheme" = "Horizon Bold";
"rust-analyzer.cargo.loadOutDirsFromCheck" = true;
"rust-analyzer.procMacro.enable" = true;
"rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer";
"rust-analyzer.updates.channel" = "nightly";
2022-04-22 07:40:28 +03:00
"editor.fontFamily" = "'${font.name}'";
"debug.console.fontFamily" = "${font.name}";
"debug.console.fontSize" = toString font.size;
"terminal.integrated.fontSize" = toString font.size;
2022-03-09 23:55:02 +03:00
"go.useLanguageServer" = true;
"rust-analyzer.checkOnSave.command" = "clippy";
"nix.enableLanguageServer" = true;
"nix.serverPath" = pkgBin "rnix-lsp";
"editor.bracketPairColorization.enabled" = true;
"editor.semanticHighlighting.enabled" = true;
2022-04-09 18:01:35 +03:00
"remote.SSH.defaultExtensions" = [
"gitpod.gitpod-remote-ssh"
];
2021-05-03 07:48:31 +03:00
};
};
2022-03-09 23:55:02 +03:00
};
services = {
gpg-agent = let
defaultCacheTtl = 3600 * 6;
maxCacheTtl = 3600 * 24;
in {
inherit defaultCacheTtl maxCacheTtl;
enable = true;
enableSshSupport = true;
sshKeys = ["8369D9CA26C3EAAAB8302A88CEE6FD14B58AA965"];
defaultCacheTtlSsh = defaultCacheTtl;
maxCacheTtlSsh = maxCacheTtl;
grabKeyboardAndMouse = false;
pinentryFlavor = "qt";
2021-05-03 07:48:31 +03:00
};
2022-03-09 23:55:02 +03:00
gammastep = {
2022-04-22 07:40:28 +03:00
enable = false;
2022-03-09 23:55:02 +03:00
latitude = 36.9;
longitude = 30.7;
};
};
xdg = {
enable = true;
configFile = {
2022-04-22 07:40:28 +03:00
"wezterm/wezterm.lua".text = import ./config/wezterm/cfg.nix {inherit font;};
"helix/themes/mytheme.toml".text = import ./config/helix/mytheme.nix {};
"helix/config.toml".text = import ./config/helix/cfg.nix {};
"helix/languages.toml".text = import ./config/helix/languages.nix {inherit pkgBin;};
2021-07-05 00:01:15 +03:00
};
2021-05-03 07:48:31 +03:00
};
2022-03-09 23:55:02 +03:00
};
2020-11-21 23:54:07 +03:00
}