From 761948de03fe68aced99e2534c28ae518f231dfd Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Wed, 17 Nov 2021 16:32:18 +0100 Subject: [PATCH] More apps, base config --- backup/modules/users/sway/waybar.nix | 8 +- home-manager/modules/alacritty/default.nix | 97 +++++ home-manager/modules/firefox/default.nix | 45 ++ home-manager/modules/fish/default.nix | 45 ++ home-manager/modules/gpg/default.nix | 27 ++ home-manager/modules/rofi/default.nix | 1 + home-manager/modules/rofi/power.rasi | 36 +- home-manager/modules/vscode/default.nix | 64 +++ home-manager/modules/vscode/settings.json | 469 +++++++++++++++++++++ home-manager/modules/waybar/default.nix | 8 +- machines/vm2/configuration.nix | 5 + modules/base/default.nix | 33 ++ modules/desktop/default.nix | 54 ++- modules/greetd/default.nix | 48 +++ modules/greetd/sway-config | 5 + 15 files changed, 912 insertions(+), 33 deletions(-) create mode 100644 home-manager/modules/alacritty/default.nix create mode 100644 home-manager/modules/firefox/default.nix create mode 100644 home-manager/modules/fish/default.nix create mode 100644 home-manager/modules/gpg/default.nix create mode 100644 home-manager/modules/vscode/default.nix create mode 100644 home-manager/modules/vscode/settings.json create mode 100644 modules/base/default.nix create mode 100644 modules/greetd/default.nix create mode 100644 modules/greetd/sway-config diff --git a/backup/modules/users/sway/waybar.nix b/backup/modules/users/sway/waybar.nix index 10ec95e..a7f2c43 100644 --- a/backup/modules/users/sway/waybar.nix +++ b/backup/modules/users/sway/waybar.nix @@ -82,12 +82,12 @@ # TODO: package as nix thingy # "custom/now_playing" = { - # exec = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI5OWJmN2YyNWYyODc0ZmZhOWVhMTZiNGM1MTQyZmUzZiIsImlhdCI6MTYwMzIyMDAyMiwiZXhwIjoxOTE4NTgwMDIyfQ.dNfjPN-cYStiPrSO-PVArJdShMWl2rdDeo8AXr1byIY"; + # exec = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token "; # format = " ♪ {}"; # interval = 2; - # on-click = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI5OWJmN2YyNWYyODc0ZmZhOWVhMTZiNGM1MTQyZmUzZiIsImlhdCI6MTYwMzIyMDAyMiwiZXhwIjoxOTE4NTgwMDIyfQ.dNfjPN-cYStiPrSO-PVArJdShMWl2rdDeo8AXr1byIY play-pause"; - # on-scroll-down = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI5OWJmN2YyNWYyODc0ZmZhOWVhMTZiNGM1MTQyZmUzZiIsImlhdCI6MTYwMzIyMDAyMiwiZXhwIjoxOTE4NTgwMDIyfQ.dNfjPN-cYStiPrSO-PVArJdShMWl2rdDeo8AXr1byIY volume-up"; - # on-scroll-up = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI5OWJmN2YyNWYyODc0ZmZhOWVhMTZiNGM1MTQyZmUzZiIsImlhdCI6MTYwMzIyMDAyMiwiZXhwIjoxOTE4NTgwMDIyfQ.dNfjPN-cYStiPrSO-PVArJdShMWl2rdDeo8AXr1byIY volume-down"; + # on-click = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token play-pause"; + # on-scroll-down = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token volume-up"; + # on-scroll-up = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token volume-down"; # }; "sway/window" = { diff --git a/home-manager/modules/alacritty/default.nix b/home-manager/modules/alacritty/default.nix new file mode 100644 index 0000000..9490825 --- /dev/null +++ b/home-manager/modules/alacritty/default.nix @@ -0,0 +1,97 @@ +{ lib, pkgs, config, ... }: +with lib; +let + cfg = config.eboskma.programs.alacritty; +in +{ + options.eboskma.programs.alacritty.enable = mkEnableOption "Enable alacritty"; + + config = mkIf cfg.enable { + + programs.alacritty = { + enable = true; + settings = { + window = { + decorations = "full"; + startup_mode = "Maximized"; + }; + + scrolling = { + history = 100000; + }; + font = { + normal = { + family = "CaskaydiaCove Nerd Font"; + style = "Medium"; + }; + size = 10.0; + }; + colors = { + primary = { + background = "#2e3440"; + foreground = "#d8dee9"; + dim_foreground = "#a5abb6"; + }; + cursor = { + text = "#2e3440"; + cursor = "#d8dee9"; + }; + vi_mode_cursor = { + text = "#2e3440"; + cursor = "#d8dee9"; + }; + selection = { + text = "CellForeground"; + background = "#4c566a"; + }; + search = { + matches = { + foreground = "CellBackground"; + background = "#88c0d0"; + }; + bar = { + background = "#434c5e"; + foreground = "#d8dee9"; + }; + }; + normal = { + black = "#3b4252"; + red = "#bf616a"; + green = "#a3be8c"; + yellow = "#ebcb8b"; + blue = "#81a1c1"; + magenta = "#b48ead"; + cyan = "#88c0d0"; + white = "#e5e9f0"; + }; + bright = { + black = "#4c566a"; + red = "#bf616a"; + green = "#a3be8c"; + yellow = "#ebcb8b"; + blue = "#81a1c1"; + magenta = "#b48ead"; + cyan = "#8fbcbb"; + white = "#eceff4"; + }; + dim = { + black = "#373e4d"; + red = "#94545d"; + green = "#809575"; + yellow = "#b29e75"; + blue = "#68809a"; + magenta = "#8c738c"; + cyan = "#6d96a5"; + white = "#aeb3bb"; + }; + background_opacity = 0.9; + live_config_reload = true; + mouse = { + hide_when_typing = true; + }; + + }; + }; + }; + }; +} diff --git a/home-manager/modules/firefox/default.nix b/home-manager/modules/firefox/default.nix new file mode 100644 index 0000000..1a3e3d3 --- /dev/null +++ b/home-manager/modules/firefox/default.nix @@ -0,0 +1,45 @@ +{ pkgs, config, lib, ... }: +with lib; + +let + cfg = config.eboskma.programs.firefox; + + profileSettings = { + "devtools.theme" = "dark"; + "widget.content.allow-gtk-dark-theme" = true; + "ui.key.menuAccessKeyFocuses" = false; + "image.avif.enable" = true; + "privacy.webrtc.allowSilencingNotifications" = true; + "privacy.webrtc.legacyGlobalIndicator" = false; + }; +in +{ + options.eboskma.programs.firefox = { + enable = mkEnableOption "enable firefox"; + work = mkOption { + description = "whether this is a work config"; + type = types.bool; + default = false; + }; + }; + + config = mkIf (cfg.enable) { + programs.firefox = { + enable = true; + + profiles = { + private = { + id = 0; + isDefault = !cfg.work; + settings = profileSettings; + }; + + horus = { + id = 1; + isDefault = cfg.work; + settings = profileSettings; + }; + }; + }; + }; +} diff --git a/home-manager/modules/fish/default.nix b/home-manager/modules/fish/default.nix new file mode 100644 index 0000000..2d518e0 --- /dev/null +++ b/home-manager/modules/fish/default.nix @@ -0,0 +1,45 @@ +{ pkgs, config, lib, ... }: +with lib; + +let cfg = config.eboskma.programs.fish; +in +{ + options.eboskma.programs.fish = { + enable = mkEnableOption "Enable fish shell"; + }; + + config = mkIf (cfg.enable) { + programs.fish = { + enable = true; + + # interactiveShellInit = '' + # ''; + }; + + programs.starship = { + enable = true; + enableFishIntegration = true; + }; + + programs.fzf = { + enable = true; + enableFishIntegration = true; + changeDirWidgetCommand = "${pkgs.fd}/bin/fd -type d"; + defaultCommand = "${pkgs.fd}/bin/fd -type f"; + defaultOptions = [ + "--cycle" + "--layout=reverse" + "--border" + "--height=90%" + "--preview-window=wrap" + "--marker='*'" + ]; + fileWidgetCommand = "${pkgs.fd}/bin/fd -type f"; + }; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + }; +} diff --git a/home-manager/modules/gpg/default.nix b/home-manager/modules/gpg/default.nix new file mode 100644 index 0000000..d847a74 --- /dev/null +++ b/home-manager/modules/gpg/default.nix @@ -0,0 +1,27 @@ +{ pkgs, config, lib, ... }: +with lib; +let cfg = config.eboskma.programs.gpg; +in +{ + options.eboskma.programs.gpg = { + enable = mkEnableOption "enable gpg"; + }; + + config = mkIf (cfg.enable) { + home.packages = with pkgs; [ + pinentry-curses + ]; + + programs.gpg = { + enable = true; + }; + + services.gpg-agent = { + enable = true; + pinentryFlavor = "curses"; + enableSshSupport = true; + defaultCacheTtlSsh = 14400; + maxCacheTtlSsh = 14400; + }; + }; +} diff --git a/home-manager/modules/rofi/default.nix b/home-manager/modules/rofi/default.nix index 5dc5b2e..a3d709e 100644 --- a/home-manager/modules/rofi/default.nix +++ b/home-manager/modules/rofi/default.nix @@ -12,6 +12,7 @@ in enable = true; package = pkgs.rofi-wayland; theme = ./launch.rasi; + terminal = "${pkgs.alacritty}/bin/alacritty"; }; }; } diff --git a/home-manager/modules/rofi/power.rasi b/home-manager/modules/rofi/power.rasi index 663df45..26a5fef 100644 --- a/home-manager/modules/rofi/power.rasi +++ b/home-manager/modules/rofi/power.rasi @@ -6,7 +6,7 @@ configuration { * { blue: #009ad1; - orange: #d14200; + orange: #d14200; text: #efefef; text-alt: #c2c2c2; bg: #333333; @@ -15,26 +15,26 @@ configuration { background-color: transparent; font: "DroidSansMono Nerd Font Mono, 14, FontAwesome5Free, 14"; - highlight: bold; + highlight: bold; text-color: @text; } window { transparency: "real"; - y-offset: -1.5em; - x-offset: -0.5em; - width: 27em; - background-color: transparent; + y-offset: -1.5em; + x-offset: -0.5em; + width: 27em; + background-color: transparent; } inputbar { - enabled: false; - border: 1px; - border-color: @orange; + enabled: false; + border: 1px; + border-color: @orange; border-radius: 5px; - padding: 10px; - margin: 0 5px; - background-color: @bg; + padding: 10px; + margin: 0 5px; + background-color: @bg; } prompt { @@ -57,8 +57,8 @@ listview { dynamic: true; scrollbar: false; lines: 1; - columns: 5; - background-color: transparent; + columns: 5; + background-color: transparent; } element { @@ -67,8 +67,8 @@ element { highlight: bold #95ee8f; /* green */ background-color: @bg; border-radius: 5px; - border: 1px; - border-color: @orange; + border: 1px; + border-color: @orange; } element-icon { size: 1em; @@ -76,8 +76,8 @@ element-icon { } element selected { - border: 0 0 0 1px; - background-color: @blue; + border: 0 0 0 1px; + background-color: @blue; text-color: @text; } diff --git a/home-manager/modules/vscode/default.nix b/home-manager/modules/vscode/default.nix new file mode 100644 index 0000000..1f16904 --- /dev/null +++ b/home-manager/modules/vscode/default.nix @@ -0,0 +1,64 @@ +{ lib, pkgs, config, ... }: +with lib; +let cfg = config.eboskma.programs.vscode; +in +{ + options.eboskma.programs.vscode.enable = mkEnableOption "enable vscode"; + + config = mkIf cfg.enable { + + programs.vscode = { + enable = true; + package = pkgs.vscode; + extensions = with pkgs.vscode-extensions; [ + bbenoist.nix + brettm12345.nixfmt-vscode + # aaronduino.nix-lsp + # aliariff.auto-add-brackets + bradlc.vscode-tailwindcss + # bungcip.better-toml + coolbear.systemd-unit-file + # dawhite.mustache + dbaeumer.vscode-eslint + denoland.vscode-deno + # dlasagno.rasi + # dprint.dprint + editorconfig.editorconfig + esbenp.prettier-vscode + # EugenWiens.bitbake + elixir-lsp.vscode-elixir-ls # this is the one by Jake Becker, not the deprecated one + # kumar-harsh.graphql-for-vscode + matklad.rust-analyzer + # monokai.theme-monokai-pro-vscode + ms-azuretools.vscode-docker + ms-python.python + ms-python.vscode-pylance + ms-toolsai.jupyter + # ms-toolsai.jupyter-keymap + # ms-toolsai.jupyter-renderers + # ms-vscode-remote.remote-containers + ms-vscode-remote.remote-ssh + # ms-vscode-remote.remote-ssh-edit + # ms-vscode.cmake-tools + ms-vscode.cpptools + # msaraiva.surface + # pgourlain.erlang + # phoenixframework.phoenix + # surajbarkale.ninja + timonwong.shellcheck + # twxs.cmake + # vscode-icons-team.vscode-icons + vscodevim.vim + wholroyd.jinja + xaver.clang-format + zxh404.vscode-proto3 + ]; + + userSettings = (builtins.fromJSON (builtins.readFile ./settings.json)); + }; + + home.packages = with pkgs; [ + rnix-lsp + ]; + }; +} diff --git a/home-manager/modules/vscode/settings.json b/home-manager/modules/vscode/settings.json new file mode 100644 index 0000000..ba968cb --- /dev/null +++ b/home-manager/modules/vscode/settings.json @@ -0,0 +1,469 @@ +{ + "editor.formatOnSave": true, + "editor.fontFamily": "Iosevka Nerd Font", + "workbench.iconTheme": "vscode-icons", + "editor.fontLigatures": true, + "vsicons.dontShowNewVersionMessage": true, + "workbench.startupEditor": "newUntitledFile", + "rust-analyzer.cargo.allFeatures": true, + "rust-analyzer.checkOnSave.command": "clippy", + "editor.suggestSelection": "first", + "git.autofetch": true, + "vim.cursorStylePerMode.insert": "line", + "vim.cursorStylePerMode.normal": "block", + "vim.cursorStylePerMode.replace": "block-outline", + "vim.cursorStylePerMode.visual": "underline", + "vim.cursorStylePerMode.visualblock": "underline", + "vim.cursorStylePerMode.visualline": "underline", + "vim.normalModeKeyBindingsNonRecursive": [ + { + "before": ["h"], + "after": ["h"] + }, + { + "before": ["n"], + "after": ["j"] + }, + { + "before": ["e"], + "after": ["k"] + }, + { + "before": ["i"], + "after": ["l"] + }, + { + "before": ["l"], + "after": ["b"] + }, + { + "before": ["L"], + "after": ["B"] + }, + { + "before": ["u"], + "after": ["e"] + }, + { + "before": ["U"], + "after": ["E"] + }, + { + "before": ["y"], + "after": ["W"] + }, + { + "before": ["Y"], + "after": ["W"] + }, + { + "before": ["s"], + "after": ["i"] + }, + { + "before": ["S"], + "after": ["I"] + }, + { + "before": ["t"], + "after": ["a"] + }, + { + "before": ["T"], + "after": ["A"] + }, + { + "before": ["w"], + "after": ["c"] + }, + { + "before": ["W"], + "after": ["C"] + }, + { + "before": ["ww"], + "after": ["cc"] + }, + { + "before": ["x"], + "after": ["x"] + }, + { + "before": ["c"], + "after": ["y"] + }, + { + "before": ["v"], + "after": ["p"] + }, + { + "before": ["X"], + "after": ["dd"] + }, + { + "before": ["C"], + "after": ["yy"] + }, + { + "before": ["V"], + "after": ["P"] + }, + { + "before": ["gv"], + "after": ["gp"] + }, + { + "before": ["gV"], + "after": ["gP"] + }, + { + "before": ["z"], + "after": ["u"] + }, + { + "before": ["gz"], + "after": ["U"] + }, + { + "before": ["Z"], + "after": [""] + }, + { + "before": ["a"], + "after": ["v"] + }, + { + "before": ["A"], + "after": ["V"] + }, + { + "before": ["ga"], + "after": ["gv"] + }, + { + "before": ["p"], + "after": ["t"] + }, + { + "before": ["P"], + "after": ["T"] + }, + { + "before": ["b"], + "after": [";"] + }, + { + "before": ["B"], + "after": [","] + }, + { + "before": ["k"], + "after": ["n"] + }, + { + "before": ["K"], + "after": ["N"] + }, + { + "before": ["j"], + "after": ["z"] + }, + { + "before": ["jn"], + "after": ["zj"] + }, + { + "before": ["je"], + "after": ["zk"] + }, + { + "before": ["gX"], + "after": ["X"] + }, + { + "before": ["gK"], + "after": ["K"] + }, + { + "before": ["gL"], + "after": ["L"] + }, + { + "before": ["h"], + "after": ["h"] + }, + { + "before": ["n"], + "after": ["j"] + }, + { + "before": ["e"], + "after": ["k"] + }, + { + "before": ["i"], + "after": ["l"] + } + ], + "vim.visualModeKeyBindingsNonRecursive": [ + { + "before": ["h"], + "after": ["h"] + }, + { + "before": ["n"], + "after": ["j"] + }, + { + "before": ["e"], + "after": ["k"] + }, + { + "before": ["i"], + "after": ["l"] + }, + { + "before": ["l"], + "after": ["b"] + }, + { + "before": ["L"], + "after": ["B"] + }, + { + "before": ["u"], + "after": ["e"] + }, + { + "before": ["U"], + "after": ["E"] + }, + { + "before": ["y"], + "after": ["W"] + }, + { + "before": ["Y"], + "after": ["W"] + }, + { + "before": ["w"], + "after": ["c"] + }, + { + "before": ["W"], + "after": ["C"] + }, + { + "before": ["x"], + "after": ["x"] + }, + { + "before": ["c"], + "after": ["y"] + }, + { + "before": ["v"], + "after": ["p"] + }, + { + "before": ["X"], + "after": ["d"] + }, + { + "before": ["C"], + "after": ["y"] + }, + { + "before": ["V"], + "after": ["P"] + }, + { + "before": ["gv"], + "after": ["gp"] + }, + { + "before": ["gV"], + "after": ["gP"] + }, + { + "before": ["z"], + "after": [":undo"] + }, + { + "before": ["gz"], + "after": [":undo"] + }, + { + "before": ["Z"], + "after": [":redo"] + }, + { + "before": ["a"], + "after": ["v"] + }, + { + "before": ["A"], + "after": ["V"] + }, + { + "before": [" s"], + "after": ["(mode() =~# \"[V]\" ? \"0o$I\" : \"I\""] + }, + { + "before": [" S"], + "after": ["(mode() =~# \"[V]\" ? \"0o$I\" : \"I\""] + }, + { + "before": [" t"], + "after": ["(mode() =~# \"[V]\" ? \"0o$A\" : \"I\""] + }, + { + "before": [" T"], + "after": ["(mode() =~# \"[V]\" ? \"0o$A\" : \"I\""] + }, + { + "before": ["p"], + "after": ["t"] + }, + { + "before": ["P"], + "after": ["T"] + }, + { + "before": ["b"], + "after": [";"] + }, + { + "before": ["B"], + "after": [","] + }, + { + "before": ["k"], + "after": ["n"] + }, + { + "before": ["K"], + "after": ["N"] + }, + { + "before": ["j"], + "after": ["z"] + }, + { + "before": ["jn"], + "after": ["zj"] + }, + { + "before": ["je"], + "after": ["zk"] + }, + { + "before": ["gX"], + "after": ["X"] + }, + { + "before": ["gK"], + "after": ["K"] + }, + { + "before": ["gL"], + "after": ["L"] + }, + { + "before": ["h"], + "after": ["h"] + }, + { + "before": ["n"], + "after": ["j"] + }, + { + "before": ["e"], + "after": ["k"] + }, + { + "before": ["i"], + "after": ["l"] + } + ], + "vim.textwidth": 120, + "workbench.editor.enablePreviewFromQuickOpen": false, + "editor.lineNumbers": "relative", + "emmet.includeLanguages": { + "html-leex": "html" + }, + "emmet.triggerExpansionOnTab": true, + "python.languageServer": "Default", + "shellcheck.executablePath": "/usr/bin/shellcheck", + "shellcheck.enableQuickFix": true, + "shellcheck.customArgs": ["--enable=all"], + "python.defaultInterpreterPath": "/usr/bin/python", + "workbench.colorTheme": "Monokai Pro", + "[elixir]": { + "editor.defaultFormatter": "JakeBecker.elixir-ls" + }, + "remote.SSH.useLocalServer": false, + "remote.SSH.remotePlatform": { + "horus-vpn": "linux", + "horus": "linux" + }, + "tailwindCSS.includeLanguages": { + "svelte": "html", + "surface": "html" + }, + "tailwindCSS.emmetCompletions": true, + "docker.showStartPage": false, + "workbench.editorAssociations": { + "*.ipynb": "jupyter.notebook.ipynb" + }, + "zigLanguageClient.path": "/home/erwin/zls/zls", + "zig.buildOnSave": true, + "editor.cursorStyle": "line", + "editor.wordSeparators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-", + "editor.wordWrap": "off", + "editor.tabSize": 2, + "[typescript]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[svelte]": { + "editor.defaultFormatter": "svelte.svelte-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[markdown]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[rust]": { + "editor.defaultFormatter": "dprint.dprint" + }, + "[cpp]": { + "editor.defaultFormatter": "xaver.clang-format" + }, + "files.associations": { + "*.livemd": "markdown" + }, + "[python]": { + "editor.tabSize": 4 + }, + "editor.minimap.enabled": false, + "editor.bracketPairColorization.enabled": true, + "[nix]": { + "editor.defaultFormatter": "aaronduino.nix-lsp" + }, + "python.formatting.provider": "black", + "telemetry.telemetryLevel": "off" +} diff --git a/home-manager/modules/waybar/default.nix b/home-manager/modules/waybar/default.nix index e9ebbc1..d081a95 100644 --- a/home-manager/modules/waybar/default.nix +++ b/home-manager/modules/waybar/default.nix @@ -90,12 +90,12 @@ in # TODO: package as nix thingy # "custom/now_playing" = { - # exec = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI5OWJmN2YyNWYyODc0ZmZhOWVhMTZiNGM1MTQyZmUzZiIsImlhdCI6MTYwMzIyMDAyMiwiZXhwIjoxOTE4NTgwMDIyfQ.dNfjPN-cYStiPrSO-PVArJdShMWl2rdDeo8AXr1byIY"; + # exec = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token "; # format = " ♪ {}"; # interval = 2; - # on-click = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI5OWJmN2YyNWYyODc0ZmZhOWVhMTZiNGM1MTQyZmUzZiIsImlhdCI6MTYwMzIyMDAyMiwiZXhwIjoxOTE4NTgwMDIyfQ.dNfjPN-cYStiPrSO-PVArJdShMWl2rdDeo8AXr1byIY play-pause"; - # on-scroll-down = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI5OWJmN2YyNWYyODc0ZmZhOWVhMTZiNGM1MTQyZmUzZiIsImlhdCI6MTYwMzIyMDAyMiwiZXhwIjoxOTE4NTgwMDIyfQ.dNfjPN-cYStiPrSO-PVArJdShMWl2rdDeo8AXr1byIY volume-up"; - # on-scroll-up = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI5OWJmN2YyNWYyODc0ZmZhOWVhMTZiNGM1MTQyZmUzZiIsImlhdCI6MTYwMzIyMDAyMiwiZXhwIjoxOTE4NTgwMDIyfQ.dNfjPN-cYStiPrSO-PVArJdShMWl2rdDeo8AXr1byIY volume-down"; + # on-click = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token "; + # on-scroll-down = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token "; + # on-scroll-up = "${HOME}/.config/waybar/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token "; # }; "sway/window" = { diff --git a/machines/vm2/configuration.nix b/machines/vm2/configuration.nix index 795c890..c334df6 100644 --- a/machines/vm2/configuration.nix +++ b/machines/vm2/configuration.nix @@ -3,6 +3,10 @@ imports = [ ./hardware-configuration.nix ]; eboskma = { + base = { + plymouth.enable = true; + work = false; + }; desktop = { enable = true; home-manager = true; @@ -10,6 +14,7 @@ nix-common = { enable = true; }; + greetd.enable = true; }; boot.loader.systemd-boot.enable = true; diff --git a/modules/base/default.nix b/modules/base/default.nix new file mode 100644 index 0000000..98f35c2 --- /dev/null +++ b/modules/base/default.nix @@ -0,0 +1,33 @@ +{ pkgs, config, lib, ... }: +with lib; + +let + cfg = config.eboskma.base; +in +{ + options.eboskma.base = { + kernel = mkOption { + description = "which kernel to run"; + type = types.unspecified; + default = pkgs.linuxKernel.packages.linux_5_14; + }; + + plymouth = { + enable = mkEnableOption "enable plymouth splash screen"; + }; + + work = mkOption { + description = "whether this is a work machine."; + type = types.bool; + default = false; + }; + }; + + config = { + boot.kernelPackages = cfg.kernel; + + boot.plymouth = mkIf (cfg.plymouth.enable) { + enable = true; + }; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index bf5170e..d7e778b 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -33,31 +33,71 @@ in eboskma = { programs = { - sway.enable = true; + alacritty.enable = true; + firefox = { + enable = true; + work = config.eboskma.base.work; + }; + fish.enable = true; + gpg.enable = true; rofi.enable = true; + vscode.enable = true; + sway.enable = true; waybar.enable = true; }; }; home.packages = with pkgs; [ (nerdfonts.override { fonts = [ "CascadiaCode" "FantasqueSansMono" "FiraCode" "Iosevka" "JetBrainsMono" "Meslo" "Noto" "SourceCodePro" ]; }) - (callPackage ../../pkgs/pamedia { }) + bitwarden + gnome.nautilus + jetbrains.clion + neovim + signal-desktop + steam + tdesktop + unzip ]; + xdg = { + enable = true; + }; + imports = [ { nixpkgs.overlays = [ self-overlay ]; } + ../../home-manager/modules/alacritty + ../../home-manager/modules/firefox + ../../home-manager/modules/fish + ../../home-manager/modules/gpg + ../../home-manager/modules/rofi + ../../home-manager/modules/vscode ../../home-manager/modules/sway ../../home-manager/modules/waybar - ../../home-manager/modules/rofi ]; }; - services.pipewire = { - enable = true; - pulse.enable = true; - media-session.enable = true; + xdg = { + mime.enable = true; + menus.enable = true; + icons.enable = true; + sounds.enable = true; + autostart.enable = true; + portal = { + enable = true; + wlr.enable = true; + gtkUsePortal = true; + }; + }; + + services = { + pipewire = { + enable = true; + pulse.enable = true; + media-session.enable = true; + }; + }; }; } diff --git a/modules/greetd/default.nix b/modules/greetd/default.nix new file mode 100644 index 0000000..e549cdb --- /dev/null +++ b/modules/greetd/default.nix @@ -0,0 +1,48 @@ +{ pkgs, config, lib, ... }: +with lib; +let + cfg = config.eboskma.greetd; +in +{ + options.eboskma.greetd = { + enable = mkEnableOption "enable greetd"; + }; + + config = mkIf (cfg.enable) + { + services.greetd = { + enable = true; + package = pkgs.greetd.gtkgreet; + restart = true; + settings = { + default_session = { + command = "${pkgs.sway}/bin/sway --config /etc/greetd/sway-config"; + }; + }; + }; + + environment.etc = { + "greetd/sway-config" = { + text = '' + # `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. + exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit" + bindsym Mod4+shift+e exec swaynag \ + -t warning \ + -m 'What do you want to do?' \ + -b 'Poweroff' 'systemctl poweroff' \ + -b 'Reboot' 'systemctl reboot' + ''; + user = "greeter"; + group = "greeter"; + }; + "greetd/environments" = { + text = '' + ${pkgs.sway}/bin/sway + ${pkgs.bash}/bin/bash + ''; + user = "greeter"; + group = "greeter"; + }; + }; + }; +} diff --git a/modules/greetd/sway-config b/modules/greetd/sway-config new file mode 100644 index 0000000..f04fad5 --- /dev/null +++ b/modules/greetd/sway-config @@ -0,0 +1,5 @@ +exec "gtkgreet -l; swaymsg exit" + +bindsym Mod4+shift+e exec swaynag -t warning -m 'What would you like to do?' -b 'Poweroff' 'systemctl poweroff' -b 'Reboot' 'systemctl reboot' + +include /etc/sway/config.d/*