diff options
Diffstat (limited to 'tv/2configs')
-rw-r--r-- | tv/2configs/default.nix (renamed from tv/2configs/base.nix) | 40 | ||||
-rw-r--r-- | tv/2configs/vim.nix | 9 | ||||
-rw-r--r-- | tv/2configs/xserver/default.nix | 14 | ||||
-rw-r--r-- | tv/2configs/z.nix | 40 |
4 files changed, 76 insertions, 27 deletions
diff --git a/tv/2configs/base.nix b/tv/2configs/default.nix index 41159690d..d31862b60 100644 --- a/tv/2configs/base.nix +++ b/tv/2configs/default.nix @@ -1,11 +1,29 @@ { config, lib, pkgs, ... }: -with builtins; with lib; { krebs.enable = true; + krebs.build = { + user = config.krebs.users.tv; + target = mkDefault "root@${config.krebs.build.host.name}"; + source = { + git.nixpkgs = { + url = mkDefault https://github.com/NixOS/nixpkgs; + rev = mkDefault "c44a593aa43bba6a0708f6f36065a514a5110613"; + target-path = mkDefault "/var/src/nixpkgs"; + }; + dir.secrets = { + path = mkDefault "/home/tv/secrets/${config.krebs.build.host.name}"; + }; + dir.stockholm = { + path = mkDefault "/home/tv/stockholm"; + target-path = mkDefault "/var/src/stockholm"; + }; + }; + }; + networking.hostName = config.krebs.build.host.name; imports = [ @@ -23,6 +41,9 @@ with lib; (import <secrets/hashedPasswords.nix>); } { + users.groups.subusers.gid = 1093178926; # genid subusers + } + { users.defaultUserShell = "/run/current-system/sw/bin/bash"; users.mutableUsers = false; } @@ -31,6 +52,7 @@ with lib; root = { openssh.authorizedKeys.keys = [ config.krebs.users.tv.pubkey + config.krebs.users.tv_xu.pubkey ]; }; tv = { @@ -69,22 +91,8 @@ with lib; nix.useChroot = true; } { - # oldvim - environment.systemPackages = with pkgs; [ - vim - ]; - - environment.etc."vim/vimrc".text = '' - set nocp - ''; + environment.profileRelativeEnvVars.PATH = mkForce [ "/bin" ]; - environment.etc."vim/vim${majmin pkgs.vim.version}".source = - "${pkgs.vim}/share/vim/vim${majmin pkgs.vim.version}"; - - environment.variables.EDITOR = mkForce "vim"; - environment.variables.VIM = "/etc/vim"; - } - { environment.systemPackages = with pkgs; [ rxvt_unicode.terminfo ]; diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 8c6c9fb45..04b1480c1 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -50,6 +50,8 @@ let set wildmenu set wildmode=longest,full + set et ts=2 sts=2 sw=2 + filetype plugin indent on set t_Co=256 @@ -64,9 +66,10 @@ let au BufRead,BufNewFile *.nix so ${pkgs.writeText "nix.vim" '' setf nix + set isk=@,48-57,_,192-255,-,' " Ref <nix/src/libexpr/lexer.l> - syn match INT /[0-9]\+/ + syn match INT /\<[0-9]\+\>/ syn match PATH /[a-zA-Z0-9\.\_\-\+]*\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ syn match HPATH /\~\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ syn match SPATH /<[a-zA-Z0-9\.\_\-\+]\+\(\/[a-zA-Z0-9\.\_\-\+]\+\)*>/ @@ -77,8 +80,8 @@ let hi link SPATH Constant hi link URI Constant - syn match String /"\([^"]\|\\\"\)*"/ - syn match Comment /\s#.*/ + syn match String /"\([^\\"]\|\\.\)*"/ + syn match Comment /\(^\|\s\)#.*/ ''} au BufRead,BufNewFile /dev/shm/* set nobackup nowritebackup noswapfile diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index 4d2fe9e45..7a48db6b8 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -34,7 +34,13 @@ let }; environment.systemPackages = [ + pkgs.ff + pkgs.gitAndTools.qgit + pkgs.mpv + pkgs.pavucontrol pkgs.slock + pkgs.sxiv + pkgs.zathura ]; security.setuidPrograms = [ @@ -70,14 +76,6 @@ let ExecStart = "${xserver}/bin/xserver"; }; }; - - programs.bash.interactiveShellInit = '' - case ''${XMONAD_SPAWN_WORKSPACE-} in - za|zh|zj|zs) - exec sudo -u zalora -i - ;; - esac - ''; }; xmonad-environment = { diff --git a/tv/2configs/z.nix b/tv/2configs/z.nix new file mode 100644 index 000000000..e5494ecc9 --- /dev/null +++ b/tv/2configs/z.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + krebs.per-user.z.packages = [ + (pkgs.writeScriptBin "cr" '' + #! /bin/sh + set -efu + export LC_TIME=de_DE.utf8 + exec ${pkgs.chromium}/bin/chromium \ + --ssl-version-min=tls1 \ + --disk-cache-dir=/tmp/chromium-disk-cache_"$LOGNAME" \ + --disk-cache-size=50000000 \ + "%@" + '') + ]; + + programs.bash.interactiveShellInit = '' + case ''${XMONAD_SPAWN_WORKSPACE-} in + za|zh|zj|zs) + exec sudo -u z -i + ;; + esac + ''; + + security.sudo.extraConfig = "tv ALL=(z) NOPASSWD: ALL"; + + users.users.z = { + extraGroups = [ + "audio" + "vboxusers" + "video" + ]; + group = "subusers"; + home = "/home/z"; + uid = 3043726074; # genid z + useDefaultShell = true; + }; +} |