summaryrefslogtreecommitdiff
path: root/profiles/core
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2023-10-06 23:10:55 +0200
committerMike Vink <mike1994vink@gmail.com>2023-10-06 23:10:55 +0200
commitcfaef26e8718916adcc68fbfb63b15f2389b2cd2 (patch)
tree3989af4514d31d0a5cb89e8b96d51210ad7bf152 /profiles/core
parent654ec06ab6a885ea851c4cbf68d06a00b41b0e14 (diff)
move all the files
Diffstat (limited to 'profiles/core')
-rw-r--r--profiles/core/configuration.nix154
-rw-r--r--profiles/core/hm.nix24
-rw-r--r--profiles/core/home.nix242
3 files changed, 420 insertions, 0 deletions
diff --git a/profiles/core/configuration.nix b/profiles/core/configuration.nix
new file mode 100644
index 0000000..e677306
--- /dev/null
+++ b/profiles/core/configuration.nix
@@ -0,0 +1,154 @@
+{
+ config,
+ pkgs,
+ ...
+}: {
+ users.users.mike = {
+ isNormalUser = true;
+ extraGroups = ["wheel" "networkmanager" "docker" "transmission"];
+ };
+
+ virtualisation.docker.enable = true;
+
+ hardware.keyboard.qmk.enable = true;
+ services.udev.extraRules = ''
+ # Atmel DFU
+ ### ATmega16U2
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2fef", TAG+="uaccess"
+ ### ATmega32U2
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", TAG+="uaccess"
+ ### ATmega16U4
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff3", TAG+="uaccess"
+ ### ATmega32U4
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", TAG+="uaccess"
+ ### AT90USB64
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff9", TAG+="uaccess"
+ ### AT90USB162
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffa", TAG+="uaccess"
+ ### AT90USB128
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", TAG+="uaccess"
+
+ # Input Club
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", ATTRS{idProduct}=="b007", TAG+="uaccess"
+
+ # STM32duino
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0003", TAG+="uaccess"
+ # STM32 DFU
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess"
+
+ # BootloadHID
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", TAG+="uaccess"
+
+ # USBAspLoader
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", TAG+="uaccess"
+
+ # USBtinyISP
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1782", ATTRS{idProduct}=="0c9f", TAG+="uaccess"
+
+ # ModemManager should ignore the following devices
+ # Atmel SAM-BA (Massdrop)
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+
+ # Caterina (Pro Micro)
+ ## pid.codes shared PID
+ ### Keyboardio Atreus 2 Bootloader
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2302", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ## Spark Fun Electronics
+ ### Pro Micro 3V3/8MHz
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9203", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ### Pro Micro 5V/16MHz
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9205", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ### LilyPad 3V3/8MHz (and some Pro Micro clones)
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9207", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ## Pololu Electronics
+ ### A-Star 32U4
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1ffb", ATTRS{idProduct}=="0101", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ## Arduino SA
+ ### Leonardo
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ### Micro
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ## Adafruit Industries LLC
+ ### Feather 32U4
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000c", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ### ItsyBitsy 32U4 3V3/8MHz
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000d", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ### ItsyBitsy 32U4 5V/16MHz
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="000e", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ## dog hunter AG
+ ### Leonardo
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+ ### Micro
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0037", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+
+ # hid_listen
+ KERNEL=="hidraw*", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
+
+ # hid bootloaders
+ ## QMK HID
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2067", TAG+="uaccess"
+ ## PJRC's HalfKay
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0478", TAG+="uaccess"
+
+ # APM32 DFU
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="314b", ATTRS{idProduct}=="0106", TAG+="uaccess"
+
+ # GD32V DFU
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="28e9", ATTRS{idProduct}=="0189", TAG+="uaccess"
+
+ # WB32 DFU
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="342d", ATTRS{idProduct}=="dfa0", TAG+="uaccess"
+ '';
+
+ boot.loader.systemd-boot.enable = true;
+ boot.loader.efi.canTouchEfiVariables = true;
+
+ networking.hostName = "lemptop";
+ networking.networkmanager.enable = true;
+ time.timeZone = "Europe/Amsterdam";
+
+ services.xserver.enable = true;
+ services.xserver.displayManager.startx.enable = true;
+ services.xserver.libinput.enable = true;
+
+ services.udev.packages = [ pkgs.yubikey-personalization ];
+ services.pcscd.enable = true;
+ security.pam.services = {
+ login.u2fAuth = true;
+ sudo.u2fAuth = true;
+ };
+
+ sound.enable = true;
+ security.rtkit.enable = true;
+ services.pipewire = {
+ enable = true;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ };
+
+ services.transmission = {
+ enable = true;
+ };
+
+ hardware.bluetooth.enable = true;
+ services.blueman.enable = true;
+
+ programs.slock.enable = true;
+
+ documentation.dev.enable = true;
+ environment.systemPackages = with pkgs; [
+ man-pages
+ man-pages-posix
+ vim
+ wget
+ git
+ pinentry-curses
+ ];
+
+ system.stateVersion = "23.05";
+ nix.package = pkgs.nixUnstable;
+ nix.extraOptions = ''
+ experimental-features = nix-command flakes
+ '';
+}
diff --git a/profiles/core/hm.nix b/profiles/core/hm.nix
new file mode 100644
index 0000000..e1a29d6
--- /dev/null
+++ b/profiles/core/hm.nix
@@ -0,0 +1,24 @@
+{inputs, config, lib, ...}: {
+ imports = [
+ inputs.home-manager.nixosModules.default
+ (mkAliasOptionModule [ "hm" ] [ "home-manager" "users" my.username ])
+ ];
+
+ system.extraDependencies = collectFlakeInputs inputs.home-manager;
+
+ home-manager = {
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ verbose = true;
+ extraSpecialArgs = { inherit inputs; };
+ };
+
+ hm = {
+ home.stateVersion = config.system.stateVersion;
+ home.enableNixpkgsReleaseCheck = false;
+
+ systemd.user.startServices = "sd-switch";
+
+ manual.html.enable = true;
+ };
+}
diff --git a/profiles/core/home.nix b/profiles/core/home.nix
new file mode 100644
index 0000000..5d57f76
--- /dev/null
+++ b/profiles/core/home.nix
@@ -0,0 +1,242 @@
+{
+ inputs,
+ config,
+ pkgs,
+ ...
+}: {
+ programs.home-manager.enable = true;
+ home.homeDirectory = "/home/${username}";
+ home.username = username;
+ home.stateVersion = "23.05";
+ fonts.fontconfig.enable = true;
+ xdg = {
+ enable = true;
+ configFile = with config.lib.meta; {
+ "emacs/init.el".source = mkMutableSymlink ./emacs/init.el;
+ };
+ mimeApps = {
+ enable = true;
+ defaultApplications = {
+ "text/x-shellscript" = ["text.desktop"];
+ "x-scheme-handler/magnet" = ["torrent.desktop"];
+ "application/x-bittorrent" = ["torrent.desktop"];
+ "x-scheme-handler/mailto" = ["mail.desktop"];
+ "text/plain" = ["text.desktop"];
+ "application/postscript" = ["pdf.desktop"];
+ "application/pdf" = ["pdf.desktop"];
+ "image/png" = ["img.desktop"];
+ "image/jpeg" = ["img.desktop"];
+ "image/gif" = ["img.desktop"];
+ "application/rss+xml" = ["rss.desktop"];
+ "video/x-matroska" = ["video.desktop"];
+ "video/mp4" = ["video.desktop"];
+ "x-scheme-handler/lbry" = ["lbry.desktop"];
+ "inode/directory" = ["file.desktop"];
+ };
+ };
+ mime.enable = true;
+ desktopEntries = {
+ text= { type = "Application"; name = "Text editor"; exec = "${pkgs.st}/bin/st -e kak %u"; };
+ file = { type = "Application"; name = "File Manager"; exec = "${pkgs.st}/bin/st -e lfub %u"; };
+ torrent = { type = "Application"; name = "Torrent"; exec = "${pkgs.coreutils}/bin/env transadd %U"; };
+ img = { type = "Application"; name = "Image Viewer"; exec = "${pkgs.sxiv}/bin/sxiv -a %u"; };
+ video = { type = "Application"; name = "Video Viewer"; exec = "${pkgs.mpv}/bin/mpv -quiet %f"; };
+ mail = { type = "Application"; name = "Mail"; exec = "${pkgs.st}/bin/st -e neomutt %u"; };
+ pdf = { type = "Application"; name = "PDF reader"; exec = "${pkgs.zathura}/bin/zathura %u"; };
+ rss = { type = "Application"; name = "RSS feed addition"; exec = "${pkgs.coreutils}/bin/env rssadd %u"; };
+ };
+ };
+
+ programs.ssh = {
+ enable = true;
+ matchBlocks = {
+ "*" = {
+ identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519";
+ };
+ };
+ };
+
+ home.sessionVariables = {
+ EDITOR = "kak";
+ TERMINAL = "st";
+ };
+
+ home.sessionPath = [
+ "${config.home.homeDirectory}/.krew/bin"
+ "${config.home.homeDirectory}/.cargo/bin"
+ "${pkgs.ncurses}/bin"
+ ];
+
+ programs.starship.enable = true;
+
+ programs.direnv = {
+ enable = true;
+ nix-direnv.enable = true;
+ };
+
+ programs.readline = {
+ enable = true;
+ extraConfig = ''
+ $if mode=vi
+
+ set keymap vi-command
+ # these are for vi-command mode
+ Control-l: clear-screen
+
+ set keymap vi-insert
+ # these are for vi-insert mode
+ Control-l: clear-screen
+ $endif
+ '';
+ };
+
+ programs.emacs = {
+ enable = true;
+ package = pkgs.emacs29;
+ };
+
+ programs.tmux = {
+ enable = true;
+ extraConfig = ''
+ set-option -g default-shell ${pkgs.bashInteractive}/bin/bash
+ set -s set-clipboard on
+ setw -g mouse on
+ set -g default-terminal "st-256color"
+ set -ga terminal-overrides ",xterm-256color:Tc"
+ set-option -g focus-events on
+ set-option -sg escape-time 10
+ # unbind C-b
+ # set -g prefix C-space
+ # bind C-space send-prefix
+
+ bind-key R source ${config.xdg.configHome}/tmux/tmux.conf; display-message "sourced ${config.xdg.configHome}/tmux/tmux.conf!"
+
+ set-window-option -g mode-keys vi
+ bind-key -T copy-mode-vi v send -X begin-selection
+ bind-key -T copy-mode-vi V send -X select-line
+ bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
+ bind-key -T copy-mode-vi : command-prompt
+
+ bind-key -T window k select-pane -t '{up-of}'
+ bind-key -T window j select-pane -t '{down-of}'
+ bind-key -T window l select-pane -t '{right-of}'
+ bind-key -T window h select-pane -t '{left-of}'
+ bind-key -T window = select-layout even-vertical
+ bind-key -T window o kill-pane -a
+ bind-key -T window _ resize-pane -y 90%
+ bind-key -T window n run-shell '
+ window="$(tmux display -p "#{window_name}")"
+ if [[ "''${window##kakc@}" != "$window" ]]; then
+ tmux splitw "kak -c ''${window##kakc@}"
+ else
+ tmux splitw "kak -c ''${KAK_SERVER##kaks@}"
+ fi
+ '
+ bind -n C-space switch-client -T window
+
+ bind -n C-s run-shell tmux-normal-mode
+ bind -n C-q run-shell 'tmux-normal-mode --quit'
+ '';
+ };
+
+ programs.bash = {
+ enable = true;
+ bashrcExtra = ''
+ export PATH=$PATH:$HOME/.local/bin
+ [[ -f ~/.cache/wal/sequences ]] && (cat ~/.cache/wal/sequences &)
+ unset LD_PRELOAD
+ if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
+ . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
+ fi
+ # include nix.sh if it exists
+ [[ -f ~/.nix-profile/etc/profile.d/nix.sh ]] && . ~/.nix-profile/etc/profile.d/nix.sh
+ # source some workspace specific stuff
+ [[ -f ~/env.sh ]] && . ~/env.sh
+ export COLORTERM=truecolor
+ export GPG_TTY="$(tty)"
+ export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
+ gpgconf --launch gpg-agent
+ '';
+ shellAliases = {
+ e = "kakup ";
+ es = "kakup -f";
+ k9s = "k9s";
+ k = "kubectl ";
+ d = "docker ";
+ ls = "ls --color=auto";
+ s = "sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/flake#";
+ b = "/run/current-system/bin/switch-to-configuration boot";
+ h = "home-manager switch --flake ${config.home.homeDirectory}/flake --impure";
+ fa = "azdo-switch-project";
+ v = "nvim";
+ V = "nvim -S .vimsession.vim";
+ M = "xrandr --output HDMI1 --auto --output eDP1 --off";
+ m = "xrandr --output eDP1 --auto --output HDMI1 --off";
+ mM = "xrandr --output eDP1 --auto --output HDMI1 --off";
+ newflake = "nix flake new -t ~/flake ";
+ ansible-flake = "nix flake new -t ~/flake#ansible ";
+ go-flake = "nix flake new -t ~/flake#go ";
+ lock-pass = "gpgconf --kill gpg-agent";
+ };
+ };
+
+ programs.nushell.enable = true;
+
+ programs.git = {
+ enable = true;
+ userName = "Mike Vink";
+ userEmail = email;
+ extraConfig = {
+ worktree.guessRemote = true;
+ mergetool.fugitive.cmd = "vim -f -c \"Gdiff\" \"$MERGED\"";
+ merge.tool = "fugitive";
+ };
+ ignores = [
+ "/.direnv/"
+ "/.envrc"
+ "/.env"
+ ".vimsession.vim"
+ ];
+ };
+
+ # https://github.com/drduh/config/blob/master/gpg.conf
+ # https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration-Options.html
+ # https://www.gnupg.org/documentation/manuals/gnupg/GPG-Esoteric-Options.html
+ programs.gpg = {
+ enable = true;
+ scdaemonSettings = {
+ disable-ccid = true;
+ };
+ settings = {
+ personal-cipher-preferences = "AES256 AES192 AES";
+ personal-digest-preferences = "SHA512 SHA384 SHA256";
+ personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed";
+ default-preference-list = "SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed";
+ cert-digest-algo = "SHA512";
+ s2k-digest-algo = "SHA512";
+ s2k-cipher-algo = "AES256";
+ charset = "utf-8";
+ fixed-list-mode = true;
+ no-comments = true;
+ no-emit-version = true;
+ no-greeting = true;
+ keyid-format = "0xlong";
+ list-options = "show-uid-validity";
+ verify-options = "show-uid-validity";
+ "with-fingerprint" = true;
+ require-cross-certification = true;
+ no-symkey-cache = true;
+ use-agent = true;
+ throw-keyids = true;
+ };
+ };
+ services.gpg-agent = {
+ enable = true;
+ enableSshSupport = true;
+ defaultCacheTtl = 34550000;
+ maxCacheTtl = 34550000;
+ };
+ programs.password-store = {
+ enable = true;
+ };
+}