From f814970ded962c8efff2dce373fabc7676313b94 Mon Sep 17 00:00:00 2001 From: 4Lost Date: Tue, 11 Mar 2025 12:26:41 +0100 Subject: [PATCH 1/8] install slack --- builds/flutter.nix | 82 +++++++++++++++++++++++++++++++++ configuration.nix | 17 +++++-- home/programs/default.nix | 1 + home/programs/slack/default.nix | 5 ++ 4 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 builds/flutter.nix create mode 100644 home/programs/slack/default.nix diff --git a/builds/flutter.nix b/builds/flutter.nix new file mode 100644 index 0000000..9ea9c3b --- /dev/null +++ b/builds/flutter.nix @@ -0,0 +1,82 @@ +{ config, lib, pkgs, ... }: +with lib; +let + cfg = config.programs.flutter; + androidComposition = pkgs.androidenv.composeAndroidPackages { + toolsVersion = "26.1.1"; + platformToolsVersion = "35.0.1"; + buildToolsVersions = [ + "30.0.3" + "33.0.1" + "34.0.0" + ]; + platformVersions = [ + "31" + "33" + "34" + ]; + abiVersions = [ "x86_64" ]; + includeEmulator = true; + emulatorVersion = "35.1.4"; + includeSystemImages = true; + systemImageTypes = [ "google_apis_playstore" ]; + includeSources = false; + extraLicenses = [ + "android-googletv-license" + "android-sdk-arm-dbt-license" + "android-sdk-license" + "android-sdk-preview-license" + "google-gdk-license" + "intel-android-extra-license" + "intel-android-sysimage-license" + "mips-android-sysimage-license" + ]; + }; + androidSdk = androidComposition.androidsdk; + buildToolsVersion = "33.0.1"; +in { + options.programs.flutter = { + enable = mkEnableOption "Flutter development environment"; + addToKvmGroup = mkEnableOption "Add user to KVM group for hardware acceleration"; + enableAdb = mkEnableOption "Enable ADB and add user to adbusers group"; + user = mkOption { + type = types.str; + description = "Username for Flutter development"; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + flutter + androidSdk + # android-studio + jdk17 + firebase-tools + ]; + + environment.variables = { + ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk"; + ANDROID_HOME = "${androidSdk}/libexec/android-sdk"; + JAVA_HOME = "${pkgs.jdk17}"; + GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/libexec/android-sdk/build-tools/34.0.0/aapt2"; + }; + + nixpkgs.config = { + android_sdk.accept_license = true; + allowUnfree = true; + }; + + environment.shellInit = '' + export PATH=$PATH:${androidSdk}/libexec/android-sdk/platform-tools + export PATH=$PATH:${androidSdk}/libexec/android-sdk/cmdline-tools/latest/bin + export PATH=$PATH:${androidSdk}/libexec/android-sdk/emulator + export PATH="$PATH":"$HOME/.pub-cache/bin" + ''; + + programs.adb.enable = cfg.enableAdb; + + users.users.${cfg.user}.extraGroups = + (optional cfg.addToKvmGroup "kvm") ++ (optional cfg.enableAdb "adbusers"); + }; +} + diff --git a/configuration.nix b/configuration.nix index 9094ee5..3657d52 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,8 +17,8 @@ }; }; - # Importing necessary setup for Steam. - imports = [ ./builds/steam/default.nix ./home/extras/printer.nix ]; + # Importing necessary setup for Steam & Printing & Flutter. + imports = [ ./builds/steam/default.nix ./home/extras/printer.nix ./builds/flutter.nix ]; # Use the systemd-boot EFI boot loader. boot.loader = { @@ -160,9 +160,20 @@ nixpkgs.config = { allowUnfree = true; - permittedInsecurePackages = [ "electron-25.9.0" ]; + permittedInsecurePackages = [ "electron-32.3.3" ]; }; + # Virtualbox + boot.kernelParams = [ "kvm.enable_virt_at_load=0" ]; + boot.kernelModules = ["kvm-amd"]; + virtualisation.virtualbox.host.enable = true; + users.extraGroups.vboxusers.members = [ "user-with-access-to-virtualbox" "kv" ]; + virtualisation.virtualbox.host.enableExtensionPack = true; + virtualisation.virtualbox.guest.enable = true; + virtualisation.virtualbox.guest.dragAndDrop = true; + virtualisation.virtualbox.host.enableKvm = true; + virtualisation.virtualbox.host.addNetworkInterface = false; + # Enable zsh for setting it as shell for users. programs.zsh.enable = true; diff --git a/home/programs/default.nix b/home/programs/default.nix index 11e5570..a9a8f0d 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -27,6 +27,7 @@ ./rofi ./signal ./skanlite + ./slack ./spotify ./stack ./telegram diff --git a/home/programs/slack/default.nix b/home/programs/slack/default.nix new file mode 100644 index 0000000..fd6aa5b --- /dev/null +++ b/home/programs/slack/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ slack ]; +} From f8d228d493ebe13917a74f7b62fda691c3d1e7a4 Mon Sep 17 00:00:00 2001 From: 4Lost Date: Tue, 11 Mar 2025 13:31:31 +0100 Subject: [PATCH 2/8] fix impure --- home/programs/xmonad/src/xmobar/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/programs/xmonad/src/xmobar/default.nix b/home/programs/xmonad/src/xmobar/default.nix index d8acd4f..83b117d 100644 --- a/home/programs/xmonad/src/xmobar/default.nix +++ b/home/programs/xmonad/src/xmobar/default.nix @@ -3,7 +3,7 @@ with pkgs; haskellPackages.mkDerivation { pname = "xmobar"; version = "0.1.0.0"; - src = /etc/nixos/home/programs/xmonad/src/xmobar/.; + src = ./.; isLibrary = false; isExecutable = true; executableHaskellDepends = with haskellPackages; [ base xmobar ]; From c834f6adbd1d13528129da16aac9c9a3002b7d2a Mon Sep 17 00:00:00 2001 From: 4Lost Date: Sat, 22 Mar 2025 09:32:18 +0100 Subject: [PATCH 3/8] remove maestral --- home/programs/default.nix | 1 - home/programs/maestral/default.nix | 5 ----- 2 files changed, 6 deletions(-) delete mode 100644 home/programs/maestral/default.nix diff --git a/home/programs/default.nix b/home/programs/default.nix index a9a8f0d..89455de 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -14,7 +14,6 @@ ./inkscape ./ktouch ./libreoffice - ./maestral ./neovim ##./nixvim ./nextcloud diff --git a/home/programs/maestral/default.nix b/home/programs/maestral/default.nix deleted file mode 100644 index f6e60ce..0000000 --- a/home/programs/maestral/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: - -{ - home.packages = with pkgs; [ maestral maestral-gui ]; -} From 9e388357f36c7a3a18721341ec5f4d9562805423 Mon Sep 17 00:00:00 2001 From: 4Lost Date: Sun, 23 Mar 2025 10:35:37 +0100 Subject: [PATCH 4/8] remove zulip --- home/programs/default.nix | 3 --- home/programs/zulip/default.nix | 5 ----- 2 files changed, 8 deletions(-) delete mode 100644 home/programs/zulip/default.nix diff --git a/home/programs/default.nix b/home/programs/default.nix index 89455de..59b4b3d 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -3,7 +3,6 @@ ./alacritty ./anki ./calibre - #./cura ./discord ./dolphin ./dunst @@ -15,7 +14,6 @@ ./ktouch ./libreoffice ./neovim - ##./nixvim ./nextcloud ./obs ./picard @@ -37,6 +35,5 @@ ./xmonad ./zoom ./zsh - ./zulip ]; } diff --git a/home/programs/zulip/default.nix b/home/programs/zulip/default.nix deleted file mode 100644 index 8b858ec..0000000 --- a/home/programs/zulip/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: - -{ - home.packages = with pkgs; [ zulip ]; -} From 043b6f55c83a50f8221aa6758535f0384772664f Mon Sep 17 00:00:00 2001 From: 4Lost Date: Sun, 23 Mar 2025 23:08:39 +0100 Subject: [PATCH 5/8] update hardware-config --- hardware-configuration-desktop.nix | 9 ++++++--- home/programs/alacritty/default.nix | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hardware-configuration-desktop.nix b/hardware-configuration-desktop.nix index 0244581..73a30cd 100644 --- a/hardware-configuration-desktop.nix +++ b/hardware-configuration-desktop.nix @@ -14,17 +14,20 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/fcd3cb1a-9ca3-42a1-981d-84b8a709eb26"; + { device = "/dev/disk/by-label/NIXROOT"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/1A1E-0B59"; + { device = "/dev/disk/by-label/NIXBOOT"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; - swapDevices = [ ]; + swapDevices = [{ + device = "/.swapfile"; + size = 2048; + }]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/home/programs/alacritty/default.nix b/home/programs/alacritty/default.nix index 1b03c33..bee155d 100644 --- a/home/programs/alacritty/default.nix +++ b/home/programs/alacritty/default.nix @@ -4,7 +4,7 @@ let theme = builtins.fetchurl { url = "https://github.com/catppuccin/alacritty/raw/main/catppuccin-mocha.toml"; - sha256 = "1rnc6gsqjdvkb6xbv1pnawrp6f0j5770dqml2di90j3lhv0fppgw"; + sha256 = "1idjbm5jim9b36235hgwgp9ab81fmbij42y7h85l4l7cqcbyz74l"; }; in { home.packages = with pkgs; [ fira-code alacritty-theme ]; From 5449978ad95013b1cb1cde171f676079827152a5 Mon Sep 17 00:00:00 2001 From: 4Lost Date: Mon, 24 Mar 2025 08:19:51 +0100 Subject: [PATCH 6/8] add openscad --- home/programs/default.nix | 1 + home/programs/openscad/default.nix | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 home/programs/openscad/default.nix diff --git a/home/programs/default.nix b/home/programs/default.nix index 59b4b3d..26f7de8 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -16,6 +16,7 @@ ./neovim ./nextcloud ./obs + ./openscad ./picard ./planify ./prismlauncher diff --git a/home/programs/openscad/default.nix b/home/programs/openscad/default.nix new file mode 100644 index 0000000..f21fa9b --- /dev/null +++ b/home/programs/openscad/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ gnumake openscad ]; +} From 61a35c611a74f4bdd05580ac77223f6d3a9ed3e9 Mon Sep 17 00:00:00 2001 From: 4Lost Date: Sun, 20 Apr 2025 01:15:08 +0200 Subject: [PATCH 7/8] update - no xmobar, missing passages --- flake.lock | 197 ++++++++++++------ flake.nix | 10 +- home/programs/neovim/default.nix | 9 +- .../neovim/lua/plugins/conform-nvim.lua | 2 +- home/programs/rofi/default.nix | 6 +- home/programs/signal/default.nix | 2 +- home/programs/vscode/default.nix | 2 +- overlays/obsidian.nix | 2 +- 8 files changed, 159 insertions(+), 71 deletions(-) diff --git a/flake.lock b/flake.lock index bd4aae6..d7de9ff 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1732722421, - "narHash": "sha256-HRJ/18p+WoXpWJkcdsk9St5ZiukCqSDgbOGFa8Okehg=", + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "9ed2ac151eada2306ca8c418ebd97807bb08f6ac", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1730504689, - "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -62,11 +62,11 @@ ] }, "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -74,6 +74,27 @@ "type": "indirect" } }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems_2" @@ -117,18 +138,14 @@ "nixpkgs": [ "neovim-nightly-overlay", "nixpkgs" - ], - "nixpkgs-stable": [ - "neovim-nightly-overlay", - "nixpkgs" ] }, "locked": { - "lastModified": 1732021966, - "narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=", + "lastModified": 1742649964, + "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "3308484d1a443fc5bc92012435d79e80458fe43c", + "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", "type": "github" }, "original": { @@ -139,7 +156,7 @@ }, "git-ignore-nix": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1709087332, @@ -158,7 +175,7 @@ }, "git-ignore-nix_2": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1709087332, @@ -206,11 +223,11 @@ ] }, "locked": { - "lastModified": 1730903510, - "narHash": "sha256-mnynlrPeiW0nUQ8KGZHb3WyxAxA3Ye/BH8gMjdoKP6E=", + "lastModified": 1744693102, + "narHash": "sha256-1Z4WPGVky4w3lrhrgs89OKsLzPdtkbi1bPLNFWsoLfY=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "b89ac4d66d618b915b1f0a408e2775fe3821d141", + "rev": "5b6cec51c9ec095a0d3fd4c8eeb53eb5c59ae33e", "type": "github" }, "original": { @@ -226,11 +243,11 @@ ] }, "locked": { - "lastModified": 1732482255, - "narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=", + "lastModified": 1744987093, + "narHash": "sha256-IVioWVz5qVtHiqosesW7CJW//m/yADr7cVdgF1P4N8s=", "owner": "nix-community", "repo": "home-manager", - "rev": "a9953635d7f34e7358d5189751110f87e3ac17da", + "rev": "5e6a8203cee7cc33b2e0d9a0adb7268f46447292", "type": "github" }, "original": { @@ -248,14 +265,15 @@ "neovim-src": "neovim-src", "nixpkgs": [ "nixpkgs" - ] + ], + "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1732775233, - "narHash": "sha256-G9W0wi0MD9JvG3bmvWQSMVR684drSlWGY1auhCNxO8c=", + "lastModified": 1744960122, + "narHash": "sha256-9bIzs90K5+baT7C9Jy2/Q6WMfgeZ+tX5MyIwC+VHl60=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "b09ab000f85a830fac6f599947dfa268227aab31", + "rev": "e3bc827059b3e1606d48c8b0d492e0101b7b32ff", "type": "github" }, "original": { @@ -267,11 +285,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1732733768, - "narHash": "sha256-y3LmGebXuQhLz9w1IzkDU8b464WvMvPCbIImpVvxmcI=", + "lastModified": 1744932170, + "narHash": "sha256-XG8mE3iggeRRi5MdYYJtmXiDxuA2c4w57UgZfLLqxKQ=", "owner": "neovim", "repo": "neovim", - "rev": "76dcc7029b200e1d85024d7ba4a34c602e730dbe", + "rev": "b4c759716a9e945b41439ae6d686c81107115516", "type": "github" }, "original": { @@ -282,11 +300,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732521221, - "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "lastModified": 1744932701, + "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", + "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef", "type": "github" }, "original": { @@ -298,16 +316,18 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1666603677, - "narHash": "sha256-apAEIj+z1iwMaMJ4tB21r/VTetfGDLDzuhXRHJknIAU=", - "owner": "NixOS", + "lastModified": 1744463964, + "narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "074da18a72269cc5a6cf444dce42daea5649b2fe", + "rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs_3": { @@ -325,10 +345,24 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1666603677, + "narHash": "sha256-apAEIj+z1iwMaMJ4tB21r/VTetfGDLDzuhXRHJknIAU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "074da18a72269cc5a6cf444dce42daea5649b2fe", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 0, - "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", - "path": "/nix/store/60sn02zhawl3kwn0r515zff3h6hg6ydz-source", + "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "path": "/nix/store/frfyxcpzsdasdin76x83krbhpgkis8b0-source", "type": "path" }, "original": { @@ -337,12 +371,17 @@ } }, "nur": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_2", + "treefmt-nix": "treefmt-nix_2" + }, "locked": { - "lastModified": 1732784817, - "narHash": "sha256-I37vvlS+qk4TMzMouw9kJCilahl8+fOjnCWsBJmPv+U=", + "lastModified": 1744987300, + "narHash": "sha256-C3GtrgAVItvuKzUbzRWGw8QWpKVBard5OX6JZMAVnFI=", "owner": "nix-community", "repo": "NUR", - "rev": "7c412613e5ed3d49f2e198c0b0187add6b897b3d", + "rev": "3df1ac0aef0f9f7664acb60ea36edced26b7a161", "type": "github" }, "original": { @@ -427,13 +466,55 @@ "type": "github" } }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744707583, + "narHash": "sha256-IPFcShGro/UUp8BmwMBkq+6KscPlWQevZi9qqIwVUWg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49d05555ccdd2592300099d6a657cc33571f4fe0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "unstable": { "locked": { - "lastModified": 1732521221, - "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "lastModified": 1744932701, + "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", + "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef", "type": "github" }, "original": { @@ -452,11 +533,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1732723146, - "narHash": "sha256-Jd/+JMMn1lgm1Oe78du6DVkFWGCWvbNuSXsIKzcCeME=", + "lastModified": 1744728945, + "narHash": "sha256-zTeJdaAaXf4aeGHY8P4EbSob9Hu/0eZ7mEaygxHX1nU=", "owner": "danyspin97", "repo": "wpaperd", - "rev": "459c4e9c8bdd0f8b0572751efc96b59a2dd4cc78", + "rev": "32377e8061578f36e4785ea15eeda2ab94f17ab6", "type": "github" }, "original": { @@ -469,15 +550,15 @@ "inputs": { "flake-utils": "flake-utils_2", "git-ignore-nix": "git-ignore-nix_2", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "unstable": "unstable" }, "locked": { - "lastModified": 1731735867, - "narHash": "sha256-eaC4wCtkpj/jvpc0X+7B/DI7p479lQEq1aPcf52V4EY=", + "lastModified": 1744559834, + "narHash": "sha256-4AeqylaTW3B+iIab7/JobZruTOU1AgDZ8s+wYaZKQos=", "owner": "xmonad", "repo": "xmonad", - "rev": "81cf71d7c6807fba14c1000aa40bfee84f7fa0e1", + "rev": "ebf265a84c6295d4fe15c4a5cf88cb08746f2145", "type": "github" }, "original": { @@ -496,11 +577,11 @@ "xmonad": "xmonad" }, "locked": { - "lastModified": 1732441885, - "narHash": "sha256-SKl/9dmpWpAs30YgQfB7jpdJuUYcPd50SqqUGGaswr0=", + "lastModified": 1744559846, + "narHash": "sha256-Cq2N2Gokz+TLz+D1TFNtc34z5OxBAuY9qmz2m6hhKpg=", "owner": "xmonad", "repo": "xmonad-contrib", - "rev": "0dc879698def6325352886c3923299cfc951ca8e", + "rev": "4b866210512b90bc532b4cd46dc5171542d0fac8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e3bea06..7147bc4 100644 --- a/flake.nix +++ b/flake.nix @@ -36,11 +36,10 @@ modules = [ ./machines/configuration-laptop.nix ./home/services/pipewire.nix - nur.nixosModules.nur + nur.modules.nixos.default home-manager.nixosModules.home-manager { home-manager = { - useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { inherit inputs; }; users.elias = import ./home/default-laptop.nix; @@ -52,7 +51,7 @@ }) inputs.neovim-nightly-overlay.overlays.default inputs.wpaperd.overlays.default - inputs.nur.overlay + inputs.nur.overlays.default (import overlays/minlog.nix) (import overlays/obsidian.nix) ]; @@ -64,11 +63,10 @@ modules = [ ./machines/configuration-desktop.nix ./home/services/pipewire.nix - nur.nixosModules.nur + nur.modules.nixos.default home-manager.nixosModules.home-manager { home-manager = { - useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { inherit inputs; }; users.elias = import ./home/default-desktop.nix; @@ -80,7 +78,7 @@ }) inputs.neovim-nightly-overlay.overlays.default inputs.wpaperd.overlays.default - inputs.nur.overlay + inputs.nur.overlays.default (import overlays/minlog.nix) (import overlays/obsidian.nix) ]; diff --git a/home/programs/neovim/default.nix b/home/programs/neovim/default.nix index 055d344..19f0f0f 100644 --- a/home/programs/neovim/default.nix +++ b/home/programs/neovim/default.nix @@ -6,7 +6,12 @@ let in { home.sessionVariables = { EDITOR = "nvim"; }; - home.packages = with pkgs; [ nerdfonts texliveFull clang-tools ]; + home.packages = with pkgs; [ + nerd-fonts.jetbrains-mono + texliveFull + clang-tools + vimPlugins.catppuccin-nvim + ]; programs.neovim = { enable = true; @@ -88,7 +93,7 @@ in { neovim-remote # Nix nixd - nixfmt + nixfmt-rfc-style # Rust rust-analyzer # Bash diff --git a/home/programs/neovim/lua/plugins/conform-nvim.lua b/home/programs/neovim/lua/plugins/conform-nvim.lua index ff49151..0f99da2 100644 --- a/home/programs/neovim/lua/plugins/conform-nvim.lua +++ b/home/programs/neovim/lua/plugins/conform-nvim.lua @@ -29,7 +29,7 @@ return { markdown = { "prettierd" }, json = { "prettierd" }, yaml = { "prettierd" }, - nix = { "nixfmt" }, + nix = { "nixfmt-rfc-style" }, tex = { "latexindent" }, c = { "clang_format" }, cpp = { "clang_format" }, diff --git a/home/programs/rofi/default.nix b/home/programs/rofi/default.nix index e46fb1a..44d7b95 100644 --- a/home/programs/rofi/default.nix +++ b/home/programs/rofi/default.nix @@ -1,7 +1,11 @@ { pkgs, ... }: { - home.packages = with pkgs; [ oranchelo-icon-theme nerdfonts xclip ]; + home.packages = with pkgs; [ + oranchelo-icon-theme + nerd-fonts.jetbrains-mono + xclip + ]; xsession.initExtra = "setxkbmap de"; # rofi pass needs this to be set diff --git a/home/programs/signal/default.nix b/home/programs/signal/default.nix index a2a5f83..e4b7ed8 100644 --- a/home/programs/signal/default.nix +++ b/home/programs/signal/default.nix @@ -1,5 +1,5 @@ { pkgs, ... }: { - home.packages = with pkgs; [ signal-desktop ]; + home.packages = with pkgs; [ signal-desktop-bin ]; } diff --git a/home/programs/vscode/default.nix b/home/programs/vscode/default.nix index 3bb58dc..9bb2a87 100644 --- a/home/programs/vscode/default.nix +++ b/home/programs/vscode/default.nix @@ -3,7 +3,7 @@ { programs.vscode = { enable = true; - extensions = with pkgs.vscode-extensions; [ + profiles.default.extensions = with pkgs.vscode-extensions; [ dracula-theme.theme-dracula vscodevim.vim yzhang.markdown-all-in-one diff --git a/overlays/obsidian.nix b/overlays/obsidian.nix index 735a03d..1f1b53b 100644 --- a/overlays/obsidian.nix +++ b/overlays/obsidian.nix @@ -3,7 +3,7 @@ final: prev: { src = prev.fetchurl { url = old.src.url; - hash = "sha256-6IHqBvZx2yxQAvADi3Ok5Le3ip2/c6qafQ3FSpPT0po="; + hash = "sha256-XVq0nQiyT2HvKQpzJIvhghsGgg4ye7uqZcyA1nH4O/o="; }; }); } From 7fb65ea258f3c485eeb3f6374136db03cbee3024 Mon Sep 17 00:00:00 2001 From: 4Lost Date: Wed, 30 Apr 2025 13:35:31 +0200 Subject: [PATCH 8/8] eww-start --- home/programs/eww/src/eww.yuck | 122 ++++----------- home/programs/eww/src/scripts/xmonad_log.sh | 4 + .../neovim/lua/plugins/catppuccin-nvim.lua | 1 + home/programs/xmonad/default.nix | 2 + home/programs/xmonad/src/xmonad.hs | 139 +++++++++--------- indent.log | 38 +++++ 6 files changed, 141 insertions(+), 165 deletions(-) create mode 100755 home/programs/eww/src/scripts/xmonad_log.sh create mode 100644 indent.log diff --git a/home/programs/eww/src/eww.yuck b/home/programs/eww/src/eww.yuck index dc2c94f..9b97f94 100644 --- a/home/programs/eww/src/eww.yuck +++ b/home/programs/eww/src/eww.yuck @@ -1,97 +1,29 @@ -(defwindow bar-primary - :monitor 0 - :geometry (geometry :x "0px" - :y "25px" - :width "100%" - :height "25px" - :anchor "top center") - :stacking "fg" - :reserve (struts :distance "50px" :side "top") - :windowtype "dock" - :wm-ignore false -(box - :orientation "horizontal" - :halign "right" - (eventbox :onclick "notify-send Left" - :onrightclick "notify-send Right" - "Click Me!") - (rightSideBar))) +(defwidget workspaces-and-windows [] + (let content (split " " (file "/tmp/xmonad-eww-log")) + (let ws-list (take 9 content) + (let win-list (drop 9 content) + (box :orientation "vertical" :class "bar" -;; The Wrapper of the rightside Information -(defwidget rightSideBar [] - (box - :space-evenly "false" - :halign "end" - (audio) - (nw) - (date) - )) + ;; Workspaces + (box :orientation "horizontal" + (for ws in ws-list + (let class (if (starts-with ws "[[") + "ws-current" + (if (starts-with ws "(") + "ws-visible" + "ws-hidden"))) + (let name (string-trim ws "[]()") + (button :onclick (format "wmctrl -s %s" name) + :class class + (label :text name)))))) -;; The Internet Information box. -(defwidget audio [] -(box :class "container" - :space-evenly "false" - :halign "end" - (label :class "iconBat" :text "${volicon} ") - (label :class "text" :text "${vol} % ") - (label :class "text" :text "${micicon} "))) - -;; The Internet Information box. -(defwidget nw [] -(box :class "container" - :space-evenly "false" - :halign "end" - (label :class "iconNWDown" :text " ") - (label :class "text" :text " ${nwdown} ") - (label :class "iconNWUp" :text " ") - (label :class "text" :text "${nwup} "))) - -;; The date Information box. -(defwidget date [] -(box :class "container" - :space-evenly "false" - :halign "end" - (label :class "iconClock" :text " ") - (label :class "text" :text "${date-time} "))) - -;; Variables - -(defpoll volicon - :interval "1s" - :initial "-" ; optional, defaults to poll at startup - `if [[ $(cut -d ' ' -f 2 <<< $(pulseaudio-ctl full-status)) == "yes" ]]; then echo "󰝟"; else echo ""; fi`) - -(defpoll vol - :interval "1s" - :initial "-" ; optional, defaults to poll at startup - `Volume=$(cut -d ' ' -f 1 <<<$(pulseaudio-ctl full-status)); echo "$(( Volume/2 ))"`) - -(defpoll micicon - :interval "1s" - :initial "-" ; optional, defaults to poll at startup - `if [[ $(cut -d ' ' -f 3 <<< $(pulseaudio-ctl full-status)) == "yes" ]]; then echo ""; else echo ""; fi`) - -(defpoll nwup ;; TODO - :interval "1s" - :initial "-" ; optional, defaults to poll at startup - `echo "up"`) - -(defpoll nwdown ; TODO - :interval "1s" - :initial "-" ; optional, defaults to poll at startup - `echo "down"`) - -(defpoll date-time - :interval "1s" - :initial "initial-value" ; optional, defaults to poll at startup - `date "+%a %d.%m.%y %H:%M:%S"`) - -;; IDK -(defwidget greeter [?text name] -(box :orientation "horizontal" - :halign "center" - :geometry (geometry :x "0px" - :y "0px" - :height "20px" - :anchor "top center") - text)) + ;; Open windows + (box :orientation "horizontal" :class "window-list" + (for win in win-list + (let class (if (starts-with win "*") "win-focused" "win") + (label :class class :text (string-trim win "*"))))) + ) + ) + ) + ) +) diff --git a/home/programs/eww/src/scripts/xmonad_log.sh b/home/programs/eww/src/scripts/xmonad_log.sh new file mode 100755 index 0000000..b7a6a58 --- /dev/null +++ b/home/programs/eww/src/scripts/xmonad_log.sh @@ -0,0 +1,4 @@ +tail -F /tmp/xmonad-eww-log | while read -r line; do + clean_line=$(echo "$line" | sed -E 's/<[^>]+>//g') + eww update xmonad_log="$clean_line" +done diff --git a/home/programs/neovim/lua/plugins/catppuccin-nvim.lua b/home/programs/neovim/lua/plugins/catppuccin-nvim.lua index b3e7c93..42938c4 100644 --- a/home/programs/neovim/lua/plugins/catppuccin-nvim.lua +++ b/home/programs/neovim/lua/plugins/catppuccin-nvim.lua @@ -5,6 +5,7 @@ return { name = "catppuccin", priority = 1000, config = function() + require("catppuccin").setup() vim.cmd.colorscheme("catppuccin-mocha") end, opts = { diff --git a/home/programs/xmonad/default.nix b/home/programs/xmonad/default.nix index e783403..9645569 100644 --- a/home/programs/xmonad/default.nix +++ b/home/programs/xmonad/default.nix @@ -19,5 +19,7 @@ xorg.xmessage ghc cabal-install + wmctrl + trayer ]; } diff --git a/home/programs/xmonad/src/xmonad.hs b/home/programs/xmonad/src/xmonad.hs index 8a0841e..05292ae 100644 --- a/home/programs/xmonad/src/xmonad.hs +++ b/home/programs/xmonad/src/xmonad.hs @@ -1,102 +1,101 @@ -import XMonad -import XMonad.Util.SpawnOnce (spawnOnce) -import XMonad.Hooks.EwmhDesktops -import XMonad.Util.EZConfig -import XMonad.Hooks.DynamicLog -import XMonad.Hooks.StatusBar -import XMonad.Hooks.StatusBar.PP -import XMonad.Layout.ThreeColumns -import XMonad.Layout.Magnifier -import XMonad.Util.ClickableWorkspaces -import XMonad.Util.Loggers import Data.ByteString (maximum) import Distribution.Compat.Prelude (print) ---import Control.Monad.RWS (All(All)) +import System.IO +import XMonad +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP +import XMonad.Layout.Magnifier +import XMonad.Layout.ThreeColumns +import XMonad.Util.ClickableWorkspaces +import XMonad.Util.EZConfig +import XMonad.Util.Loggers +import XMonad.Util.Run (spawnPipe) +import XMonad.Util.SpawnOnce (spawnOnce) + +-- import Control.Monad.RWS (All(All)) import XMonad.Hooks.ManageHelpers +main = do + xmonad . ewmhFullscreen . ewmh $ myConfig -main = xmonad . ewmhFullscreen . ewmh . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey $ myconfig +myConfig = + def + { modMask = mod4Mask + , terminal = "alacritty" + , layoutHook = avoidStruts myLayout + , normalBorderColor = "#f5c2e7" + , focusedBorderColor = "#cdd6f4" + , manageHook = manageDocks <+> myManageHooks + , startupHook = myStartupHook + , logHook = dynamicLogWithPP myXmobarPP + } + `additionalKeysP` myKeys -myconfig = def - { - modMask = mod4Mask - , layoutHook = myLayout - , terminal = "alacritty" - , normalBorderColor = "#f5c2e7" - , focusedBorderColor = "#cdd6f4" - , manageHook = myManageHooks - , startupHook = myStartupHook - } - `additionalKeysP` - [ - -- Messages - ("M-m w", spawn "xmessage 'Test Message :)'") -- type mod+x then w to pop up 'woohoo!') - -- System +myKeys = + [ -- Messages + ("M-m w", spawn "xmessage 'Test Message :)'") -- type mod+x then w to pop up 'woohoo!') + -- System , ("M-p", spawn "rofi -show \"drun\"") - -- Screenshots - , ("", spawn "maim --format=png \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Whole Screen to File + , -- Screenshots + ("", spawn "maim --format=png \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Whole Screen to File , ("M-", spawn "maim --format=png --window $(xdotool getactivewindow) \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Focused Window to File , ("S-", spawn "maim --format=png --select \"/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S).png\"") -- Selection to File , ("C-", spawn "maim --format=png | xclip -selection clipboard -t image/png") -- Whole Screen to Clipboard , ("M-C-", spawn "maim --format=png --window $(xdotool getactivewindow) | xclip -section clipboard -t image/png") -- Focused Window to Clipboard , ("C-S-", spawn "maim --format=png --select | xclip -selection clipboard -t image/png") -- Selection to Clipboard - --Program + -- Program , ("M-c", spawn "firefox") , ("M-y", spawn "signal-desktop") , ("M-x", spawn "telegram-desktop") , ("M-c", spawn "firefox") , ("M-v", spawn "thunderbird") - -- Brightness - , ("", spawn "xbacklight -inc 10") + , -- Brightness + ("", spawn "xbacklight -inc 10") , ("", spawn "xbacklight -dec 10") - -- Audio - , ("", spawn "pulseaudio-ctl mute") + , -- Audio + ("", spawn "pulseaudio-ctl mute") , ("", spawn "pulseaudio-ctl up 5") , ("", spawn "pulseaudio-ctl down 5") , ("", spawn "pulseaudio-ctl mute-input") - ] - --`removeKeysP` [ "M-S-q" ] + ] + +-- `removeKeysP` [ "M-S-q" ] myXmobarPP :: PP -myXmobarPP = def - { - ppSep = pink " • " - , ppWsSep = "" - , ppCurrent = wrap " " "" . xmobarBorder "Top" "#f38ba8" 2 - , ppVisible = wrap " " "" . xmobarBorder "Top" "#a6e3a1" 2 - , ppHidden = green . wrap " " "" - , ppHiddenNoWindows = gray . wrap " " "" - , ppUrgent = red . wrap (yellow "!") (yellow "!") - , ppTitleSanitize = xmobarStrip - , ppOrder = \[ws, l, _, wins] -> [ws, l, wins] - , ppExtras = [logTitles formatFocused formatUnfocused] - } +myXmobarPP = + def + { ppOutput = \str -> do + writeFile "/tmp/xmonad-eww-log" str + , ppCurrent = wrap "[[" "]]" + , ppVisible = wrap "(" ")" + , ppHidden = wrap " " " " + , ppHiddenNoWindows = id + , ppUrgent = wrap "!" "!" + , ppSep = " " + , ppOrder = \(ws : _ : _ : wins : _) -> [ws, wins] + , ppExtras = [logTitles formatFocused formatUnfocused] + } where - formatFocused = wrap "[" "]" . pink . ppWindow - formatUnfocused = wrap "[" "]" . gray . ppWindow + formatFocused = wrap "*" "*" . ppWindow + formatUnfocused = id . ppWindow ppWindow :: String -> String - ppWindow = xmobarRaw . (\w -> if null w then "???" else w) . shorten 15 -- set maximum length of windowtitle to 15 + ppWindow w = if null w then "???" else take 30 w - pink, gray, red, yellow, green :: String -> String - pink = xmobarColor "#f5c2e7" "" - green = xmobarColor "#a6e3a1" "" - gray = xmobarColor "#cdd6f4" "" - red = xmobarColor "#f38ba8" "" - yellow = xmobarColor "#f9e2af" "" - - -myLayout = Tall 1 (3/100) (1/2) ||| Mirror (Tall 1 (3/100) (1/2)) ||| Full ||| ThreeColMid 1 (3/100) (1/2) -- wenn wieder zoom von fokusierten Seitenfenstern gewünscht, dann Fireox fixn und: magnifiercz' 1.3 (ThreeColMid 1 (3/100) (1/2)) +myLayout = Tall 1 (3 / 100) (1 / 2) ||| Mirror (Tall 1 (3 / 100) (1 / 2)) ||| Full ||| ThreeColMid 1 (3 / 100) (1 / 2) -- wenn wieder zoom von fokusierten Seitenfenstern gewünscht, dann Fireox fixn und: magnifiercz' 1.3 (ThreeColMid 1 (3/100) (1/2)) myManageHooks :: ManageHook -myManageHooks = composeAll - [ - isDialog --> doFloat - , className =? "Xmessage" --> doCenterFloat - ] +myManageHooks = + composeAll + [ isDialog --> doFloat + , className =? "Xmessage" --> doCenterFloat + ] myStartupHook :: X () myStartupHook = do - mapM_ spawnOnce ["xmobar -x " ++ show sid | sid <- [0..9]] - spawnOnce "dropbox" - spawnOnce "nextcloud --background" + spawnOnce "nextcloud --background" + spawnOnce "trayer --edge top --align left --widthtype request --height 25 --transparent true --alpha 0 --expand false --SetDockType true --SetPartialStrut true --monitor primary &" + spawnOnce "eww open bar" diff --git a/indent.log b/indent.log new file mode 100644 index 0000000..edf3e4f --- /dev/null +++ b/indent.log @@ -0,0 +1,38 @@ +INFO: latexindent.pl version 3.24.4, 2024-07-18, a script to indent .tex files + latexindent.pl lives here: /nix/store/n170p0fiily4lcr7agswvzm84fyzi2jx-latexindent-3.24.4-tex/scripts/latexindent/ + Sun Apr 20 15:34:29 2025 + Reading input from STDIN +INFO: Processing switches: + -y|--yaml: YAML settings specified via command line +INFO: Directory for backup files and log file indent.log: + . +INFO: Perl modules are being loaded from the following directories: + /nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0/lib/perl5/5.40.0/FindBin.pm + /nix/store/zi73jrv7iqlrwg6sk8fjbfafqs7jjj1z-perl-5.40.0-env/lib/perl5/site_perl/5.40.0/YAML/Tiny.pm + /nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0/lib/perl5/5.40.0/File/Copy.pm + /nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0/lib/perl5/5.40.0/File/Basename.pm + /nix/store/3vq9qasxlqpyq1k95nq3s13g2m6w59ay-perl-5.40.0/lib/perl5/5.40.0/Getopt/Long.pm + /nix/store/zi73jrv7iqlrwg6sk8fjbfafqs7jjj1z-perl-5.40.0-env/lib/perl5/site_perl/5.40.0/File/HomeDir.pm +INFO: LatexIndent perl modules are being loaded from, for example: + /nix/store/n170p0fiily4lcr7agswvzm84fyzi2jx-latexindent-3.24.4-tex/scripts/latexindent/LatexIndent/Document.pm +INFO: YAML settings read: defaultSettings.yaml + Reading defaultSettings.yaml from /nix/store/n170p0fiily4lcr7agswvzm84fyzi2jx-latexindent-3.24.4-tex/scripts/latexindent/defaultSettings.yaml +INFO: YAML reading settings + Home directory is /home/elias + latexindent.pl didn't find indentconfig.yaml or .indentconfig.yaml + see all possible locations: https://latexindentpl.readthedocs.io/en/latest/sec-appendices.html#indentconfig-options) +INFO: YAML settings read: -y switch + YAML setting: "defaultIndent:' '" + quote found in -y switch + key: + value: defaultIndent:' ' + double-quoted string found in -y switch: "defaultIndent:' '", substitute to defaultIndent:' ' +INFO: Phase 1: searching for objects +INFO: Phase 2: finding surrounding indentation +INFO: Phase 3: indenting objects +INFO: Phase 4: final indentation check +INFO: Output routine: + Not outputting to file; see -w and -o switches for more options. + -------------- +INFO: Please direct all communication/issues to: + https://github.com/cmhughes/latexindent.pl