From 7fe99790a4fd97760c24bd8611a1bf19511cef60 Mon Sep 17 00:00:00 2001 From: Aner Zakobar Date: Wed, 23 Apr 2025 08:41:19 +0300 Subject: [PATCH] Everything works for now except dashboard and maybe some other --- README.org | 16 ++++-- azos-core | 2 +- flake.lock | 20 ++++---- flake.nix | 3 +- modules/home-manager/audio.nix | 15 ++++++ modules/home-manager/default.nix | 2 +- modules/home-manager/git.nix | 13 +---- modules/home-manager/kubernetes.nix | 19 +++++++ modules/home-manager/mpris-proxy.nix | 16 ++++++ modules/home-manager/qutebrowser-config.nix | 15 ++++++ modules/home-manager/qutebrowser-config.py | 57 +++++++++++++++++++++ modules/nixos/audio.nix | 16 ++++++ modules/nixos/bluetooth.nix | 16 ++++++ modules/nixos/default.nix | 6 +-- nixos/configuration.nix | 3 +- 15 files changed, 187 insertions(+), 32 deletions(-) mode change 100755 => 100644 flake.lock create mode 100755 modules/home-manager/audio.nix create mode 100755 modules/home-manager/kubernetes.nix create mode 100755 modules/home-manager/mpris-proxy.nix create mode 100755 modules/home-manager/qutebrowser-config.nix create mode 100644 modules/home-manager/qutebrowser-config.py create mode 100644 modules/nixos/audio.nix create mode 100755 modules/nixos/bluetooth.nix diff --git a/README.org b/README.org index c120039..b88bd90 100755 --- a/README.org +++ b/README.org @@ -30,6 +30,12 @@ For Lauretta sudo nixos-rebuild switch --flake '.?submodules=1#lauretta' #+end_src +SOmetimes + +#+begin_src bash +nix flake lock --update-input azos-core +#+end_src + ** Installing home manager #+begin_src bash @@ -92,7 +98,11 @@ nix develop .#shells.x86_64-linux.debugTexShell *** Mail *** Steam *** Reaper -*** Hardware -*** WiFi and such *** Notebook tempaltes -*** Yubikey & Encrypytion +*** Headphones +*** Extra EMACS config +*** DIRENV +https://github.com/nix-community/nix-direnv + +*** AUdio +*** Qutebrowser config diff --git a/azos-core b/azos-core index bc0d909..ff36a2a 160000 --- a/azos-core +++ b/azos-core @@ -1 +1 @@ -Subproject commit bc0d909e255fe8ca717fe5c9f746f0ad1addf03f +Subproject commit ff36a2a9b53603802c7bc1ba49aff826bc0e9477 diff --git a/flake.lock b/flake.lock old mode 100755 new mode 100644 index b83a6ec..8720089 --- a/flake.lock +++ b/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1745145915, - "narHash": "sha256-GkVoSkWMT7D7uXmt132rW5t2FSp5b+0ebr/BCGWdH3U=", + "lastModified": 1745386585, + "narHash": "sha256-KOb8RuZMAlQg1U1CAvnpNy/reUs9wuDnMBkIJ+RbQu4=", "ref": "refs/heads/master", - "rev": "bc0d909e255fe8ca717fe5c9f746f0ad1addf03f", - "revCount": 22, + "rev": "ff36a2a9b53603802c7bc1ba49aff826bc0e9477", + "revCount": 40, "type": "git", "url": "file:./azos-core" }, @@ -76,11 +76,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738702386, - "narHash": "sha256-nJj8f78AYAxl/zqLiFGXn5Im1qjFKU8yBPKoWEeZN5M=", + "lastModified": 1745279238, + "narHash": "sha256-AQ7M9wTa/Pa/kK5pcGTgX/DGqMHyzsyINfN7ktsI7Fo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "030ba1976b7c0e1a67d9716b17308ccdab5b381e", + "rev": "9684b53175fc6c09581e94cc85f05ab77464c7e3", "type": "github" }, "original": { @@ -92,11 +92,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1744932701, - "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=", + "lastModified": 1745234285, + "narHash": "sha256-GfpyMzxwkfgRVN0cTGQSkTC0OHhEkv3Jf6Tcjm//qZ0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef", + "rev": "c11863f1e964833214b767f4a369c6e6a7aba141", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d544419..5215220 100755 --- a/flake.nix +++ b/flake.nix @@ -61,7 +61,8 @@ overlays = import ./overlays {inherit inputs;}; # Reusable nixos modules you might want to export # These are usually stuff you would upstream into nixpkgs - nixosModules = inputs.azos-core.nixosModules.nixosModules; + azos-core.nixosModules = inputs.azos-core.nixosModules.nixosModules; + nixosModules = import ./modules/nixos; # Reusable home-manager modules you might want to export # These are usually stuff you would upstream into home-manager azos-core.homeManagerModules = inputs.azos-core.nixosModules.homeManagerModules; diff --git a/modules/home-manager/audio.nix b/modules/home-manager/audio.nix new file mode 100755 index 0000000..2bafb06 --- /dev/null +++ b/modules/home-manager/audio.nix @@ -0,0 +1,15 @@ +{ lib, config, pkgs, ... }: +let + isEnabled = + config.azos.home-audio.enable; +in { + options.azos.home-audio.enable = lib.mkOption { + default = true; + example = true; + type = lib.types.bool; + }; + + config = lib.mkIf isEnabled { + # home.packages = with pkgs; [pavucontrol]; + }; +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 20b7c5b..7a38a06 100755 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,3 +1,3 @@ { - imports = [./mail.nix ./encryption.nix]; + imports = [./mail.nix ./encryption.nix ./kubernetes.nix ./git.nix ./mpris-proxy.nix ./qutebrowser-config.nix ./audio.nix]; } diff --git a/modules/home-manager/git.nix b/modules/home-manager/git.nix index 7f2f963..b1150e3 100755 --- a/modules/home-manager/git.nix +++ b/modules/home-manager/git.nix @@ -1,18 +1,9 @@ -[commit] - gpgsign = true -[user] - name = Aner Zakobar - email = aner@zakobar.com - signingkey = 6D17E295C70E2674 -[credential] - helper = !pass-git-helper $@ - { lib, config, pkgs, ... }: let isEnabled = - config.azos.git.enable; + config.azos.git-config.enable; in { - optionns.azos.git.enable = lib.mkOption { + options.azos.git-config.enable = lib.mkOption { default = true; example = true; type = lib.types.bool; diff --git a/modules/home-manager/kubernetes.nix b/modules/home-manager/kubernetes.nix new file mode 100755 index 0000000..9b7bdc5 --- /dev/null +++ b/modules/home-manager/kubernetes.nix @@ -0,0 +1,19 @@ +{ lib, config, pkgs, ... }: +let + isEnabled = + config.azos.kubectl.enable; +in { + options.azos.kubectl.enable = lib.mkOption { + default = true; + example = true; + type = lib.types.bool; + }; + + config = lib.mkIf isEnabled { + home.packages = with pkgs; [ + kubectl + kubernetes-helm + velero + ]; + }; +} diff --git a/modules/home-manager/mpris-proxy.nix b/modules/home-manager/mpris-proxy.nix new file mode 100755 index 0000000..085eb36 --- /dev/null +++ b/modules/home-manager/mpris-proxy.nix @@ -0,0 +1,16 @@ +#https://xeiaso.net/talks/asg-2023-nixos/ example +{ lib, config, pkgs, ... }: +let + isEnabled = + config.azos.mpris-proxy.enable; +in { + options.azos.mpris-proxy.enable = lib.mkOption { + default = true; + example = true; + type = lib.types.bool; + }; + + config = lib.mkIf isEnabled { + services.mpris-proxy.enable = true; + }; +} diff --git a/modules/home-manager/qutebrowser-config.nix b/modules/home-manager/qutebrowser-config.nix new file mode 100755 index 0000000..010bb63 --- /dev/null +++ b/modules/home-manager/qutebrowser-config.nix @@ -0,0 +1,15 @@ +{ lib, config, pkgs, ... }: +let + isEnabled = + config.azos.qutebrowser-config.enable; +in { + options.azos.qutebrowser-config.enable = lib.mkOption { + default = true; + example = true; + type = lib.types.bool; + }; + + config = lib.mkIf isEnabled { + home.file.".config/qutebrowser/config.py".source = ./qutebrowser-config.py; + }; +} diff --git a/modules/home-manager/qutebrowser-config.py b/modules/home-manager/qutebrowser-config.py new file mode 100644 index 0000000..4867c2f --- /dev/null +++ b/modules/home-manager/qutebrowser-config.py @@ -0,0 +1,57 @@ +# Basing this heavily on ii.com qutebrowser template + +config.load_autoconfig(True) + +#Using a lot from DTs config +#https://gitlab.com/dwt1/dotfiles/-/blob/master/.config/qutebrowser/config.py +#Also using this https://github.com/miseran/tabs_are_windows/blob/main/config.py + +c.tabs.show = 'never' +c.tabs.tabs_are_windows = True +c.window.title_format = 'qute: {private}{host}{perc}{title_sep}{current_title}' + +#Search engines from DT +c.url.searchengines = { + 'DEFAULT': 'https://duckduckgo.com/?q={}', + 'am': 'https://www.amazon.com/s?k={}', #Amazon + 'aw': 'https://wiki.archlinux.org/?search={}', #Arch Wiki + 'go': 'https://www.google.com/search?q={}', #Google + 're': 'https://www.reddit.com/r/{}', 'wi': #Reddit + 'https://en.wikipedia.org/wiki/{}', #Wikipedia + 'yt': 'https://www.youtube.com/results?search_query={}', #Youtube + 'gh': 'https://github.com/search?q={}', #Qutebrowser + 'wa' : 'https://www.wolframalpha.com/input/?i={}' #Wolfram alpha +} + +#Youtube stuff from DT. +#Added media-title to MPV and youtube-dl with exwm process to track progress. +config.bind('M', 'hint links spawn mpv --title=\'${media-title}\' {hint-url}') +config.bind('Z', + 'hint links spawn emacsclient -e "(start-process '\ + '\\"youtube-dl {hint-url}\\" \\"youtube-dl {hint-url}\\" '\ + '\\"youtube-dl\\" \\"-o\\" \\"~/downloads/%(title)s.%(ext)s\\" '\ + '\\"{hint-url}\\" \\"--newline\\")"') + +config.bind('xb', 'config-cycle statusbar.show always in-mode') +c.statusbar.show = 'in-mode' + +#Only confirm if downloads +c.confirm_quit = ['downloads'] + +c.downloads.location.directory = '~/downloads' +c.downloads.location.prompt = False + +c.editor.command = ['emacsclient', '-e', '(find-file "{}")'] + +monospace = "10pt 'LiberationMono'" +c.fonts.completion.category = f"bold{monospace}" +c.fonts.completion.entry = monospace +c.fonts.debug_console = monospace +c.fonts.downloads = monospace +c.fonts.keyhint = monospace +c.fonts.messages.error = monospace +c.fonts.messages.info = monospace +c.fonts.messages.warning = monospace +c.fonts.prompts = monospace +c.fonts.statusbar = monospace +c.fonts.hints = "bold 13px 'LiberationMono'" diff --git a/modules/nixos/audio.nix b/modules/nixos/audio.nix new file mode 100644 index 0000000..1d4bc0e --- /dev/null +++ b/modules/nixos/audio.nix @@ -0,0 +1,16 @@ +{ lib, config, pkgs, ... }: +let + isEnabled = + config.azos.hardware-audio.enable; +in { + options.azos.hardware-audio.enable = lib.mkOption { + default = true; + example = true; + type = lib.types.bool; + }; + + config = lib.mkIf isEnabled { + hardware.pulseaudio.enable = true; + environment.systemPackages = with pkgs; [pavucontrol]; + }; +} diff --git a/modules/nixos/bluetooth.nix b/modules/nixos/bluetooth.nix new file mode 100755 index 0000000..1171f79 --- /dev/null +++ b/modules/nixos/bluetooth.nix @@ -0,0 +1,16 @@ +{ lib, config, pkgs, ... }: +let + isEnabled = + config.azos.bluetooth.enable; +in { + options.azos.bluetooth.enable = lib.mkOption { + default = true; + example = true; + type = lib.types.bool; + }; + + config = lib.mkIf isEnabled { + services.blueman.enable = true; + hardware.bluetooth.enable = true; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 8605069..55273f1 100755 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -1,6 +1,4 @@ -# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). -# These should be stuff you would like to share with others, not your personal configurations. { - # List your module files here - # my-module = import ./my-module.nix; + imports = [./audio.nix ./bluetooth.nix]; } + diff --git a/nixos/configuration.nix b/nixos/configuration.nix index ff2dfb2..2e3f388 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -11,6 +11,7 @@ inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480 inputs.home-manager.nixosModules.home-manager outputs.nixosModules + outputs.azos-core.nixosModules ]; # Bootloader. @@ -69,7 +70,7 @@ users.users.aner = { isNormalUser = true; description = "Aner Zakobar"; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = [ "networkmanager" "wheel" "audio"]; packages = with pkgs; []; };