From f26c55d5bea46e0b4c0bed3ef3a1258b1b9e82dc Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Sat, 12 Oct 2024 17:15:08 +0000 Subject: update --- flake.lock | 28 ++---- flake.nix | 36 +++---- lib/default.nix | 15 +-- machines/vm-aarch64.nix | 44 ++++++++- machines/work.nix | 122 ++++++++++++++++++++--- mut/bin/oath | 2 + mut/bin/pioctl | 8 -- mut/bin/recordwin | 9 ++ mut/dwm/config.h | 2 +- mut/lf/icons | 1 + mut/neovim/fnl/conf/init.fnl | 16 +-- mut/neovim/fnl/conf/pkgs/lint.fnl | 3 +- mut/neovim/fnl/conf/pkgs/lspconfig.fnl | 2 +- nix-ontopof-dockerfile.nix.example | 176 +++++++++++++++++++++++++++++++++ profiles/core/configuration.nix | 2 +- profiles/core/lf.nix | 1 + profiles/core/meta.nix | 4 +- profiles/core/packages.nix | 6 +- profiles/graphical/suckless.nix | 3 +- profiles/homeserver/radicale.nix | 1 - profiles/homeserver/tailscale.nix | 1 - profiles/homeserver/transmission.nix | 8 ++ profiles/netboot/system.nix | 44 +++------ profiles/station/caldav.nix | 4 +- 24 files changed, 413 insertions(+), 125 deletions(-) create mode 100755 mut/bin/oath delete mode 100755 mut/bin/pioctl create mode 100755 mut/bin/recordwin create mode 120000 mut/lf/icons create mode 100644 nix-ontopof-dockerfile.nix.example diff --git a/flake.lock b/flake.lock index 14d9491..5d73e46 100644 --- a/flake.lock +++ b/flake.lock @@ -310,7 +310,9 @@ }, "nix-darwin": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1712307593, @@ -372,20 +374,6 @@ } }, "nixpkgs_3": { - "locked": { - "lastModified": 1728249353, - "narHash": "sha256-7NBJm1jfMeAowE1J2oljYqWVvI9X7FyyxBY4O8uB/Os=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c8a17040be4a20b29589cb4043a9e0c36af1930e", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1720768451, "narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=", @@ -401,7 +389,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1709703039, "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", @@ -416,7 +404,7 @@ "type": "indirect" } }, - "nixpkgs_6": { + "nixpkgs_5": { "locked": { "lastModified": 1713284584, "narHash": "sha256-rRuPBJD9+yjz7tY3xC/BvFUwloutynR9piiVE6fhGqo=", @@ -439,7 +427,7 @@ "home-manager": "home-manager", "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_3", "simple-nixos-mailserver": "simple-nixos-mailserver", "sops-nix": "sops-nix" } @@ -448,7 +436,7 @@ "inputs": { "blobs": "blobs", "flake-compat": "flake-compat_4", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "utils": "utils_2" }, "locked": { @@ -467,7 +455,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_5", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { diff --git a/flake.nix b/flake.nix index 8e33ca5..525dfcd 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; nix-darwin = { url = "path:/Users/ivi/nix-darwin"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -26,14 +27,12 @@ home-manager, sops-nix, deploy-rs, - nix-darwin, ... }: let lib = - ((nixpkgs.lib.extend + (nixpkgs.lib.extend (_: _: home-manager.lib)).extend - (_: _: nix-darwin.lib)).extend - (import ./lib inputs); + (import ./lib inputs); in with lib; rec { inherit lib; @@ -102,38 +101,35 @@ }; }; - vm-aarch64 = { - system = "aarch64-linux"; + work = { + system = "aarch64-darwin"; modules = [ - ./machines/vm-aarch64.nix + ./machines/work.nix ] - ++ modulesIn ./profiles/core - ++ modulesIn ./profiles/graphical; + ++ modulesIn ./profiles/core; opts = { - isStation = true; + isDarwin = true; syncthing = { enable = true; - id = "LDZVZ6H-KO3BKC6-FMLZOND-MKXI4DF-SNT27OT-Q5KMN2M-A2DYFNQ-3BWUYA6"; + id = "GR5MHK2-HDCFX4I-Y7JYKDN-EFTQFG6-24CXSHB-M5C6R3G-2GWX5ED-VEPAQA7"; }; }; }; - }; - darwinConfigurations = mkSystems { - work = { - system = "aarch64-darwin"; + vm-aarch64 = { + system = "aarch64-linux"; modules = [ - ./machines/work.nix + ./machines/vm-aarch64.nix ] - ++ modulesIn ./profiles/core; + ++ modulesIn ./profiles/core + ++ modulesIn ./profiles/graphical; opts = { - isDarwin = true; - configPath = "/Users/${my.username}/nix-config"; + isStation = true; syncthing = { enable = true; - id = "GR5MHK2-HDCFX4I-Y7JYKDN-EFTQFG6-24CXSHB-M5C6R3G-2GWX5ED-VEPAQA7"; + id = "LDZVZ6H-KO3BKC6-FMLZOND-MKXI4DF-SNT27OT-Q5KMN2M-A2DYFNQ-3BWUYA6"; }; }; }; diff --git a/lib/default.nix b/lib/default.nix index f677a89..960a7a4 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -33,16 +33,8 @@ inputs: lib: prev: with lib; rec { }: let machine = machines.${name}; - homeManagerModule = (if lib.hasInfix "darwin" system then - [inputs.home-manager.darwinModules.default] - else - [inputs.home-manager.nixosModules.default]); - systemForPlatform = (if lib.hasInfix "darwin" system then - lib.darwinSystem - else - lib.nixosSystem); in - systemForPlatform { + lib.nixosSystem { inherit lib system; specialArgs = { inherit (inputs) self; @@ -51,7 +43,10 @@ inputs: lib: prev: with lib; rec { modules = modules ++ - homeManagerModule + (if lib.hasInfix "darwin" system then + [inputs.home-manager.darwinModules.default] + else + [inputs.home-manager.nixosModules.default]) ++ [ ({pkgs, ...}: { nixpkgs.overlays = with lib; [ diff --git a/machines/vm-aarch64.nix b/machines/vm-aarch64.nix index ed71515..c680ec1 100644 --- a/machines/vm-aarch64.nix +++ b/machines/vm-aarch64.nix @@ -6,12 +6,49 @@ system.stateVersion = "24.05"; virtualisation.vmware.guest.enable = true; virtualisation.docker.enable = true; + virtualisation.docker.rootless = { + enable = true; + setSocketVariable = true; + }; + users.groups.docker.members = [ + "nixbld1" + "nixbld10" + "nixbld11" + "nixbld12" + "nixbld13" + "nixbld14" + "nixbld15" + "nixbld16" + "nixbld17" + "nixbld18" + "nixbld19" + "nixbld2" + "nixbld20" + "nixbld21" + "nixbld22" + "nixbld23" + "nixbld24" + "nixbld25" + "nixbld26" + "nixbld27" + "nixbld28" + "nixbld29" + "nixbld3" + "nixbld30" + "nixbld31" + "nixbld32" + "nixbld4" + "nixbld5" + "nixbld6" + "nixbld7" + "nixbld8" + "nixbld9" + ]; networking.hostName = "vm-aarch64"; programs.nix-ld.enable = true; hm.xsession.initExtra = '' ${pkgs.xorg.xset}/bin/xset r rate 230 30 - [ -z "$(lsusb | grep microdox)" ] && ${pkgs.xorg.setxkbmap}/bin/setxkbmap -option "ctrl:swapcaps" ${pkgs.open-vm-tools}/bin/vmware-user-suid-wrapper wal -R dwm @@ -28,6 +65,10 @@ krew kubelogin just + (ffmpeg.override { + withXcb = true; + }) + mpv ]; services.pcscd.enable = true; @@ -108,4 +149,5 @@ # networking.interfaces.ens160.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; + nix.settings.trusted-users = [ my.username ]; } diff --git a/machines/work.nix b/machines/work.nix index 9761e5c..5b65772 100644 --- a/machines/work.nix +++ b/machines/work.nix @@ -24,7 +24,7 @@ isNormalUser = mkSinkUndeclaredOptions {}; }; config = { - home = "/Users/${my.username}"; + home = "/Users/${ivi.username}"; }; })); }; @@ -33,20 +33,20 @@ # List packages installed in system profile. To search by name, run: # $ nix-env -qaP | grep wget environment.systemPackages = - [ # pkgs.qemu - # pkgs.kitty + [ pkgs.qemu + pkgs.kitty pkgs.openssh - # pkgs.python311 - # pkgs.mpv + pkgs.python311 + pkgs.mpv pkgs.kubelogin pkgs.zsh pkgs.bashInteractive - # pkgs.awscli2 + pkgs.awscli2 pkgs.skhd - # pkgs.act + pkgs.act pkgs.yubikey-manager - # pkgs.gomplate - # pkgs.just + pkgs.gomplate + pkgs.just ]; hm = { home = { @@ -60,6 +60,106 @@ target = ".gnupg/gpg-agent.conf"; }; }; + programs.kitty = { + enable = true; + shellIntegration = { + enableZshIntegration = true; + }; + extraConfig = '' + allow_remote_control yes + cursor_shape block + font_family JetBrainsMono Nerd Font Mono + text_composition_strategy platform + cursor_blink_interval 0 + draw_minimal_borders yes + hide_window_decorations no + confirm_os_window_close 0 + macos_option_as_alt yes + linux_display_server x11 + + clear_all_shortcuts yes + kitty_mod alt + mouse_map right press ungrabbed mouse_select_command_output + map kitty_mod+v mouse_select_command_output + scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER + + map kitty_mod+shift+k change_font_size all +2.0 + map kitty_mod+shift+j change_font_size all -2.0 + + map kitty_mod+k scroll_to_prompt -1 + map kitty_mod+j scroll_to_prompt 1 + map kitty_mod+l show_last_visited_command_output + map kitty_mod+shift+l show_scrollback + + map kitty_mod+w>p show_last_visited_command_output + map kitty_mod+w>shift+p show_first_command_output_on_screen + + map kitty_mod+w>_ toggle_layout stack + map kitty_mod+w>= goto_layout fat + map kitty_mod+w>g goto_layout grid + + map kitty_mod+w>c close_window + map kitty_mod+w>j neighboring_window bottom + map kitty_mod+w>k neighboring_window top + map kitty_mod+w>h neighboring_window left + map kitty_mod+w>l neighboring_window right + map kitty_mod+w>e open_url_with_hints + map kitty_mod+w>space move_window_to_top + map kitty_mod+w>shift+k move_window_forward + map kitty_mod+w>shift+j move_window_backward + + map kitty_mod+enter new_window + map kitty_mod+r load_config_file + map cmd+c copy_to_clipboard + map cmd+v paste_from_clipboard + map cmd+q quit + + ## name: Kanagawa + ## license: MIT + ## author: Tommaso Laurenzi + ## upstream: https://github.com/rebelot/kanagawa.nvim/ + + + background #1F1F28 + foreground #DCD7BA + selection_background #2D4F67 + selection_foreground #C8C093 + url_color #72A7BC + cursor #C8C093 + + # Tabs + active_tab_background #1F1F28 + active_tab_foreground #C8C093 + inactive_tab_background #1F1F28 + inactive_tab_foreground #727169 + #tab_bar_background #15161E + + # normal + color0 #16161D + color1 #C34043 + color2 #76946A + color3 #C0A36E + color4 #7E9CD8 + color5 #957FB8 + color6 #6A9589 + color7 #C8C093 + + # bright + color8 #727169 + color9 #E82424 + color10 #98BB6C + color11 #E6C384 + color12 #7FB4CA + color13 #938AA9 + color14 #7AA89F + color15 #DCD7BA + + + # extended colors + color16 #FFA066 + color17 #FF5D62 + ''; + }; }; networking.hostName = "work"; @@ -206,7 +306,7 @@ ''} ''; }; - services.sketchybar.enable = false; + services.sketchybar.enable = true; services.yabai = { enable = false; package = pkgs.yabai; @@ -274,7 +374,7 @@ # The platform the configuration will be used on. nixpkgs.hostPlatform = "aarch64-darwin"; - users.users.${my.username} = { + users.users.${ivi.username} = { shell = pkgs.zsh; }; environment.shells = [pkgs.bashInteractive pkgs.zsh]; diff --git a/mut/bin/oath b/mut/bin/oath new file mode 100755 index 0000000..0173a2d --- /dev/null +++ b/mut/bin/oath @@ -0,0 +1,2 @@ +#!/bin/sh +nix-shell -p yubikey-manager --run 'ykman oath accounts code --single Pionative:mike@pionative.com' | xclip -f | xclip -sel c -f diff --git a/mut/bin/pioctl b/mut/bin/pioctl deleted file mode 100755 index 8bb9798..0000000 --- a/mut/bin/pioctl +++ /dev/null @@ -1,8 +0,0 @@ -#!/home/ivi/Programming/Pionative/quickstart/venv/bin/python -# -*- coding: utf-8 -*- -import re -import sys -from pioctl import cli -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(cli()) diff --git a/mut/bin/recordwin b/mut/bin/recordwin new file mode 100755 index 0000000..bb48104 --- /dev/null +++ b/mut/bin/recordwin @@ -0,0 +1,9 @@ +#!/bin/sh +if pidof ffmpeg; then + notify-send ffmpeg "killing current recording" + pkill --signal=TERM ffmpeg +else + notify-send ffmpeg "Start recording" + ffmpeg -f x11grab $(xdotool getwindowfocus getwindowgeometry | tr '\n' ' ' | gawk '{print "-video_size " $8 " -i +"$4 }') -y ~/recording.webm + notify-send ffmpeg "saved recording to ~/recording.webm" +fi diff --git a/mut/dwm/config.h b/mut/dwm/config.h index 374654a..49d70dc 100644 --- a/mut/dwm/config.h +++ b/mut/dwm/config.h @@ -3,7 +3,7 @@ /* Constants */ #define TERMINAL "st" #define TERMCLASS "St" -#define BROWSER "librewolf" +#define BROWSER "chromium" /* appearance */ static unsigned int borderpx = 3; /* border pixel of windows */ diff --git a/mut/lf/icons b/mut/lf/icons new file mode 120000 index 0000000..5cc9ec7 --- /dev/null +++ b/mut/lf/icons @@ -0,0 +1 @@ +/nix/store/yqz5fj6agapq9h3dd7dy39qgpzh8njz9-home-manager-files/.config/lf/icons \ No newline at end of file diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl index 840924f..28cb1f0 100644 --- a/mut/neovim/fnl/conf/init.fnl +++ b/mut/neovim/fnl/conf/init.fnl @@ -62,14 +62,14 @@ (local commenter (require :nvim_comment)) (commenter.setup) -(local cinnamon (require :cinnamon)) -(cinnamon.setup { - :extra_keymaps true - :override_keymaps true - :max_length 200 - :horizontal_scroll false - :default_delay 7 - :scroll_limit -1}) +; (local cinnamon (require :cinnamon)) +; (cinnamon.setup { +; :extra_keymaps true +; :override_keymaps true +; :max_length 200 +; :horizontal_scroll false +; :default_delay 7 +; :scroll_limit -1}) (fn i-grep [word file] diff --git a/mut/neovim/fnl/conf/pkgs/lint.fnl b/mut/neovim/fnl/conf/pkgs/lint.fnl index ffd517b..d9a3c13 100644 --- a/mut/neovim/fnl/conf/pkgs/lint.fnl +++ b/mut/neovim/fnl/conf/pkgs/lint.fnl @@ -16,7 +16,8 @@ {:formatters_by_ft {:python [:ruff_format :isort] :go [:goimports] - :terraform [:terraform_fmt]} + :terraform [:terraform_fmt] + :hcl [:terraform_fmt]} :format_on_save {:timeout_ms 500 :lsp_fallback false}}) diff --git a/mut/neovim/fnl/conf/pkgs/lspconfig.fnl b/mut/neovim/fnl/conf/pkgs/lspconfig.fnl index 98dda2c..d1121f2 100644 --- a/mut/neovim/fnl/conf/pkgs/lspconfig.fnl +++ b/mut/neovim/fnl/conf/pkgs/lspconfig.fnl @@ -23,7 +23,7 @@ :settings {:venvPath (.. (vim.fn.getcwd) :.venv)}}) -(lspconfig.tsserver.setup +(lspconfig.ts_ls.setup {:root_dir (lspconfig.util.root_pattern :.git diff --git a/nix-ontopof-dockerfile.nix.example b/nix-ontopof-dockerfile.nix.example new file mode 100644 index 0000000..aec17f0 --- /dev/null +++ b/nix-ontopof-dockerfile.nix.example @@ -0,0 +1,176 @@ +{ + description = "A simple Go package"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + outputs = { self, nixpkgs }: + let + + # System types to support. + supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; + + # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + + # Nixpkgs instantiated for supported system types. + nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); + + in + { + + # Requires dirty nixbld with access to docker daemon + packages = forAllSystems (system: + let + pkgs = nixpkgsFor.${system}; + getImageWithSkopeo = + let + fixName = name: builtins.replaceStrings [ "/" ":" ] [ "-" "-" ] name; + in + { imageName + , transport + # To find the digest of an image, you can use skopeo: + # see doc/functions.xml + , imageDigest + , sha256 + , os ? "linux" + , # Image architecture, defaults to the architecture of the `hostPlatform` when unset + arch ? pkgs.go.GOARCH + # This is used to set name to the pulled image + , finalImageName ? imageName + # This used to set a tag to the pulled image + , finalImageTag ? "latest" + # This is used to disable TLS certificate verification, allowing access to http registries on (hopefully) trusted networks + , tlsVerify ? true + + , name ? fixName "image-${finalImageName}-${finalImageTag}.tar" + }: + pkgs.runCommand name + { + inherit imageDigest; + imageName = finalImageName; + imageTag = finalImageTag; + impureEnvVars = pkgs.lib.fetchers.proxyImpureEnvVars; + outputHashMode = "flat"; + outputHashAlgo = "sha256"; + outputHash = sha256; + + nativeBuildInputs = [ pkgs.skopeo ]; + SSL_CERT_FILE = "${pkgs.cacert.out}/etc/ssl/certs/ca-bundle.crt"; + + sourceURL = if transport == "docker-daemon:" then "${transport}${imageDigest}" else "${transport}${imageName}@${imageDigest}"; + destNameTag = "${finalImageName}:${finalImageTag}"; + } '' + skopeo \ + --insecure-policy \ + --tmpdir=$TMPDIR \ + --override-os ${os} \ + --override-arch ${arch} \ + copy \ + --src-tls-verify=${pkgs.lib.boolToString tlsVerify} \ + "$sourceURL" "docker-archive://$out:$destNameTag" \ + | cat # pipe through cat to force-disable progress bar + ''; + pnsh = getImageWithSkopeo { + transport = "docker-daemon:"; + imageName = "pionativedev.azurecr.io/pionative/pnsh-ide-support"; + imageDigest = "sha256:976ab3d2e27ae229fa944057482772b1d7047c4e1aee026cc18ff73bc9a69193"; + sha256 = "sha256-TljHXj0t6JWs5TW0gLRUAjH7dZdY3n1RaYKxXedvqOw="; + }; + + # from: https://github.com/nix-community/home-manager/blob/70824bb5c790b820b189f62f643f795b1d2ade2e/modules/programs/neovim.nix#L412 + neovimConfig = pkgs.neovimUtils.makeNeovimConfig { + viAlias = true; + vimAlias = true; + withPython3 = false; + withRuby = false; + withNodeJs = false; + extraPython3Packages = _: []; + extraLuaPackages = _: []; + + plugins = with pkgs.vimPlugins; [ + # highlighting + nvim-treesitter.withAllGrammars + playground + gruvbox-material + kanagawa-nvim + lsp_lines-nvim + gitsigns-nvim + vim-helm + lualine-nvim + + # external + oil-nvim + vim-fugitive + venn-nvim + gv-vim + zoxide-vim + obsidian-nvim + go-nvim + + # Coding + fzf-lua + nvim-lspconfig + null-ls-nvim + lsp_signature-nvim + nvim-dap + nvim-dap-ui + nvim-nio + nvim-dap-python + luasnip + vim-test + nvim-lint + vim-surround + conform-nvim + trouble-nvim + vim-easy-align + nvim-comment + + # cmp + nvim-cmp + cmp-cmdline + cmp-nvim-lsp + cmp-buffer + cmp-path + cmp_luasnip + + # conjure + vim-racket + nvim-parinfer + hotpot-nvim + ]; + customRC = ""; + }; + + neovim-package = pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped (neovimConfig + // { + wrapRc = false; + }); + in + { + pnsh-container = pnsh; + neovim-container = pkgs.dockerTools.buildImage { + name = "pionativedev.azurecr.io/pionative/pnsh-nvim"; + fromImage = pnsh; + copyToRoot = pkgs.buildEnv { + extraPrefix = "/usr"; + name = "neovim-nix-ide-usr"; + paths = with pkgs; [ + neovim-package + docker-client + zoxide + ]; + }; + config = { + Entrypoint = ["/bin/zsh"]; + Cmd = ["-c" "boot"]; + }; + }; + }); + + # The default package for 'nix build'. This makes sense if the + # flake provides only one package or there is a clear "main" + # package. + defaultPackage = forAllSystems (system: self.packages.${system}.neovim-container); + }; +} + diff --git a/profiles/core/configuration.nix b/profiles/core/configuration.nix index 1062850..3d000f1 100644 --- a/profiles/core/configuration.nix +++ b/profiles/core/configuration.nix @@ -32,7 +32,7 @@ uid = mkIf (!machine.isDarwin) 1000; description = my.realName; openssh.authorizedKeys.keys = my.sshKeys; - extraGroups = ["wheel" "networkmanager" "docker" "transmission" "dialout" "test"]; + extraGroups = ["wheel" "networkmanager" "docker" "transmission" "dialout" "test" "libvirtd"]; isNormalUser = true; }; root = { diff --git a/profiles/core/lf.nix b/profiles/core/lf.nix index c21a0d7..ab7d686 100644 --- a/profiles/core/lf.nix +++ b/profiles/core/lf.nix @@ -1,4 +1,5 @@ {pkgs,...}: { + hm.home.packages = [pkgs.ueberzugpp pkgs.lf pkgs.nsxiv]; hm.xdg.configFile = { # "lf/cleaner".source = config.lib.meta.mkMutableSymlink /mut/lf/cleaner; # "lf/scope".source = config.lib.meta.mkMutableSymlink /mut/lf/scope; diff --git a/profiles/core/meta.nix b/profiles/core/meta.nix index 439b678..0cf0c1c 100644 --- a/profiles/core/meta.nix +++ b/profiles/core/meta.nix @@ -1,6 +1,6 @@ -{machine, inputs,lib,config, ...}: with lib; { +{inputs,lib,config, ...}: with lib; { lib.meta = { - configPath = if hasAttrByPath ["configPath"] machine then machine.configPath else "/nix-config"; + configPath = "/nix-config"; mkMutableSymlink = path: config.hm.lib.file.mkOutOfStoreSymlink (config.lib.meta.configPath + removePrefix (toString inputs.self) (toString path)); diff --git a/profiles/core/packages.nix b/profiles/core/packages.nix index 4350680..7793c95 100644 --- a/profiles/core/packages.nix +++ b/profiles/core/packages.nix @@ -32,16 +32,14 @@ with lib; # gcc gnumake file - # psmisc + psmisc bc - # mediainfo + mediainfo bat openpomodoro-cli coreutils killall ] ++ (optionals (!machine.isDarwin) [ - nsxiv - ueberzugpp man-pages man-pages-posix # pkgsi686Linux.glibc diff --git a/profiles/graphical/suckless.nix b/profiles/graphical/suckless.nix index 47d989e..fa12d06 100644 --- a/profiles/graphical/suckless.nix +++ b/profiles/graphical/suckless.nix @@ -77,7 +77,8 @@ (nerdfonts.override {fonts = ["FiraCode" "JetBrainsMono"];}) dmenu - librewolf + # librewolf + ungoogled-chromium xclip xdotool maim diff --git a/profiles/homeserver/radicale.nix b/profiles/homeserver/radicale.nix index fd2d985..6f07245 100644 --- a/profiles/homeserver/radicale.nix +++ b/profiles/homeserver/radicale.nix @@ -9,6 +9,5 @@ services.radicale = { enable = true; settings.server.hosts = [ "0.0.0.0:5232" ]; - settings.storage.filesystem_folder = "/data/radicale/collections"; }; } diff --git a/profiles/homeserver/tailscale.nix b/profiles/homeserver/tailscale.nix index 1f47960..0fb821f 100644 --- a/profiles/homeserver/tailscale.nix +++ b/profiles/homeserver/tailscale.nix @@ -4,7 +4,6 @@ enable = true; useRoutingFeatures = "server"; extraUpFlags = ["--advertise-exit-node" "--advertise-routes=${builtins.head machine.ipv4}/32"]; - extraDaemonFlags = ["--statedir=/data/tailscaled"]; authKeyFile = config.secrets.tailscale.path; }; diff --git a/profiles/homeserver/transmission.nix b/profiles/homeserver/transmission.nix index 7f4c031..4be0d1b 100644 --- a/profiles/homeserver/transmission.nix +++ b/profiles/homeserver/transmission.nix @@ -45,6 +45,14 @@ "jellyfin.${my.domain}" = { locations."/" = { proxyPass = "http://127.0.0.1:8096"; }; }; }; }; + # services = { + # jellyfin = { enable = true; group = "multimedia"; }; + # sonarr = { enable = true; group = "multimedia"; }; + # radarr = { enable = true; group = "multimedia"; }; + # bazarr = { enable = true; group = "multimedia"; }; + # readarr = { enable = true; group = "multimedia"; }; + # prowlarr = { enable = true; }; + # }; virtualisation.oci-containers = { backend = "docker"; containers = { diff --git a/profiles/netboot/system.nix b/profiles/netboot/system.nix index 7dfa6d5..b0e7945 100644 --- a/profiles/netboot/system.nix +++ b/profiles/netboot/system.nix @@ -1,49 +1,29 @@ -# sys: { pkgs, lib, ... }: let -# run-pixiecore = let -# build = sys.config.system.build; -# in pkgs.writeShellApplication { -# name = "run-pixiecore"; -# text = '' -# sudo ${pkgs.pixiecore}/bin/pixiecore \ -# boot kernel/bzImage initrd/initrd \ -# --cmdline "init=init/init loglevel=4" \ -# --debug --dhcp-no-bind \ -# --port 64172 --status-port 64172 "$@" -# ''; -# }; -# build-pixie = pkgs.writeShellApplication { -# name = "build-pixie"; -# text = '' -# nix build /nix-config\#nixosConfigurations."$1".config.system.build.kernel --impure -o kernel -# nix build /nix-config\#nixosConfigurations."$1".config.system.build.toplevel --impure -o init -# nix build /nix-config\#nixosConfigurations."$1".config.system.build.netbootRamdisk --impure -o initrd -# ''; -# }; -# in { -# networking.firewall.allowedUDPPorts = [ 67 69 4011 ]; -# networking.firewall.allowedTCPPorts = [ 64172 ]; -# environment.systemPackages = [ -# run-pixiecore -# build-pixie -# ]; -# } sys: { pkgs, lib, ... }: let run-pixiecore = let build = sys.config.system.build; in pkgs.writeShellApplication { name = "run-pixiecore"; text = '' - exec ${pkgs.pixiecore}/bin/pixiecore \ - boot ${build.kernel}/bzImage ${build.netbootRamdisk}/initrd \ - --cmdline "init=${build.toplevel}/init loglevel=4" \ + sudo ${pkgs.pixiecore}/bin/pixiecore \ + boot kernel/bzImage initrd/initrd \ + --cmdline "init=init/init loglevel=4" \ --debug --dhcp-no-bind \ --port 64172 --status-port 64172 "$@" ''; }; + build-pixie = pkgs.writeShellApplication { + name = "build-pixie"; + text = '' + nix build /nix-config\#nixosConfigurations."$1".config.system.build.kernel --impure -o kernel + nix build /nix-config\#nixosConfigurations."$1".config.system.build.toplevel --impure -o init + nix build /nix-config\#nixosConfigurations."$1".config.system.build.netbootRamdisk --impure -o initrd + ''; + }; in { networking.firewall.allowedUDPPorts = [ 67 69 4011 ]; networking.firewall.allowedTCPPorts = [ 64172 ]; environment.systemPackages = [ run-pixiecore + build-pixie ]; } diff --git a/profiles/station/caldav.nix b/profiles/station/caldav.nix index 16397d6..98674e4 100644 --- a/profiles/station/caldav.nix +++ b/profiles/station/caldav.nix @@ -27,7 +27,7 @@ type = "caldav"; url = "https://cal.${my.domain}"; userName = "mike"; - passwordCommand = ["${pkgs.bashInteractive}/bin/bash" "-c" "echo 'hi'"]; + passwordCommand = ["echo" "''"]; }; vdirsyncer = { enable = true; @@ -52,7 +52,7 @@ type = "carddav"; url = "https://cal.${my.domain}"; userName = "mike"; - passwordCommand = ["${pkgs.bashInteractive}/bin/bash" "-c" "echo 'hi'"]; + passwordCommand = ["echo" "''"]; }; vdirsyncer = { enable = true; -- cgit v1.2.3