~ruther/nixos-config

44dbf6028a640d4714ee00d2c583930660d62b99 — Rutherther 1 year, 6 months ago f9b677f
fix: fix issues
23 files changed, 102 insertions(+), 213 deletions(-)

M flake.lock
M flake.nix
M hosts/configuration.nix
M hosts/default.nix
M hosts/desktop/home.nix
M hosts/home.nix
M hosts/vm/default.nix
M hosts/vm/home.nix
M modules/desktop/gnome/default.nix
M modules/desktop/gnome/home.nix
D modules/editors/emacs/default.nix
R modules/editors/emacs/{.doom.d/config.el => doom.d/config.el}
R modules/editors/emacs/{.doom.d/custom.el => doom.d/custom.el}
R modules/editors/emacs/{.doom.d/init.el => doom.d/init.el}
R modules/editors/emacs/{.doom.d/packages.el => doom.d/packages.el}
M modules/editors/emacs/home.nix
R modules/editors/{default.nix => home.nix}
D modules/editors/nvim/default.nix
M modules/editors/nvim/home.nix
M modules/hardware/default.nix
M modules/shell/direnv.nix
R modules/shell/{default.nix => home.nix}
M modules/shell/zsh.nix
M flake.lock => flake.lock +24 -24
@@ 31,11 31,11 @@
        "ws-butler": "ws-butler"
      },
      "locked": {
        "lastModified": 1694741217,
        "narHash": "sha256-PsyQbRMvc/+5QXS5eahj6aS9xkp+eyOWO3nQ0uzqR/Y=",
        "lastModified": 1695346081,
        "narHash": "sha256-ELuMibAhsgOEIzoPb9ZodYLcde0qSEP6ZuVIvFDIb6A=",
        "owner": "nix-community",
        "repo": "nix-doom-emacs",
        "rev": "e0c972b33eb6715d4a59b7de656008609f8d77bd",
        "rev": "5bbefaee92c4277ff1961b333f9937f5180d15f3",
        "type": "github"
      },
      "original": {


@@ 64,11 64,11 @@
    "doom-snippets": {
      "flake": false,
      "locked": {
        "lastModified": 1676839496,
        "narHash": "sha256-1Ay9zi0u1lycmEeFqIxr0RWH+JvH9BnzgRzkPeWEAYY=",
        "lastModified": 1694887483,
        "narHash": "sha256-KlKhruPSLPSKqUnr5/U65arm16VrY9ORzm+XKNZhpTQ=",
        "owner": "doomemacs",
        "repo": "snippets",
        "rev": "fe4003014ae00b866f117cb193f711fd9d72fd11",
        "rev": "f022984ee1318a4015d5d081b3c3dab5a60dc6ff",
        "type": "github"
      },
      "original": {


@@ 332,11 332,11 @@
    },
    "nixpkgs-unstable": {
      "locked": {
        "lastModified": 1694959747,
        "narHash": "sha256-CXQ2MuledDVlVM5dLC4pB41cFlBWxRw4tCBsFrq3cRk=",
        "lastModified": 1695145219,
        "narHash": "sha256-Eoe9IHbvmo5wEDeJXKFOpKUwxYJIOxKUesounVccNYk=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "970a59bd19eff3752ce552935687100c46e820a5",
        "rev": "5ba549eafcf3e33405e5f66decd1a72356632b96",
        "type": "github"
      },
      "original": {


@@ 364,11 364,11 @@
    },
    "nur": {
      "locked": {
        "lastModified": 1695224719,
        "narHash": "sha256-d9C6aHzegT/9FdGgEWdL0cNvIyIHxhYOYnbLsH6iKnI=",
        "lastModified": 1695369089,
        "narHash": "sha256-3iIl4R7XJbSIXvNEwYpZfIZlZ2DTKc25HtEPh7QagH8=",
        "owner": "nix-community",
        "repo": "NUR",
        "rev": "5c2601def1f7d89a29755b7ab31d7ed9b0319862",
        "rev": "8f631f591c83db7e1ad6c4ed8eb737f231bd6994",
        "type": "github"
      },
      "original": {


@@ 396,11 396,11 @@
    "org": {
      "flake": false,
      "locked": {
        "lastModified": 1694696773,
        "narHash": "sha256-lgrfqX5YCRXZSyLHyRpYIQf+DOpHswPm7Vcw3WUCRAk=",
        "lastModified": 1695208951,
        "narHash": "sha256-GdkBhWg/bIwnQk4/a/Ief+cFtDcUJEMNqiFYO3A5sus=",
        "owner": "emacs-straight",
        "repo": "org-mode",
        "rev": "765a84ea252fd7f281340c40fdc97f696f8cac33",
        "rev": "266aac1186256aaf3fb1bb1181ee83d548092d12",
        "type": "github"
      },
      "original": {


@@ 412,11 412,11 @@
    "org-contrib": {
      "flake": false,
      "locked": {
        "lastModified": 1675694242,
        "narHash": "sha256-4Fn33CTVTCqh5TyVAggSr8Fm8/hB8Xgl+hkxh3WCrI8=",
        "lastModified": 1694946041,
        "narHash": "sha256-X/HFG6NZe5BY00KvGbcsIuf9R6Lg8x7Uhd0Y5+Q3qZU=",
        "owner": "emacsmirror",
        "repo": "org-contrib",
        "rev": "fff6c888065588527b1c1d7dd7e41c29ef767e17",
        "rev": "5eabbf22bdd4523c922a30787e98ee66c24221aa",
        "type": "github"
      },
      "original": {


@@ 460,11 460,11 @@
    "revealjs": {
      "flake": false,
      "locked": {
        "lastModified": 1694600616,
        "narHash": "sha256-R599Zdw9YzID7CRzWRcasz+ZZvZiagBFsuDWUvnNX4o=",
        "lastModified": 1695108593,
        "narHash": "sha256-1Rb3w4Mpzv81pw7FaZHdQULK6+9oZIzeQ6uCD4PvjJM=",
        "owner": "hakimel",
        "repo": "reveal.js",
        "rev": "a4b7f9dff7ef360afdb6d0cb53fd89063cbe0b66",
        "rev": "db2523db277bea632c218a7d836f27079a1be7f9",
        "type": "github"
      },
      "original": {


@@ 533,11 533,11 @@
    "ts-fold": {
      "flake": false,
      "locked": {
        "lastModified": 1694318094,
        "narHash": "sha256-PQHn0HvcWGYhvrynYfTAFWF92TzNdFGV8cfjRG6nPeQ=",
        "lastModified": 1695278494,
        "narHash": "sha256-O4NcUC1u08W8ZslqoA/i+iTaLotKwheURXQWBxLLMFc=",
        "owner": "jcs-elpa",
        "repo": "ts-fold",
        "rev": "3dd7c477fb08874d1bbbcb2588029e7ebd4b445f",
        "rev": "70b2c79ff4daa7351d4e2917b0343b9a18d4d4f2",
        "type": "github"
      },
      "original": {

M flake.nix => flake.nix +2 -2
@@ 28,13 28,13 @@
        inputs.nixpkgs.follows = "nixpkgs";
      };

      doom-emacs = {                                                        # Nix-community Doom Emacs
      doom-emacs = {
        url = "github:nix-community/nix-doom-emacs";
        inputs.nixpkgs.follows = "nixpkgs";
      };
    };

  outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, nur, nixgl, doom-emacs, ... }:   # Function that tells my flake which to use and what do what to do with the dependencies.
  outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, doom-emacs, nur, nixgl, ... }:   # Function that tells my flake which to use and what do what to do with the dependencies.
    let                                                                     # Variables that can be used in the config files.
      user = "ruther";
      location = "$HOME/.setup";

M hosts/configuration.nix => hosts/configuration.nix +3 -8
@@ 14,9 14,7 @@
{ config, lib, pkgs, inputs, user, ... }:

{
  imports =
    (import ../modules/editors) ++          # Native doom emacs instead of nix-community flake
    (import ../modules/shell);
  hardware.pulseaudio.enable = false;

  users.users.${user} = {                   # System User
    isNormalUser = true;


@@ 62,6 60,7 @@
      EDITOR = "nvim";
      VISUAL = "nvim";
    };
    pathsToLink = [ "/share/zsh" ];
    systemPackages = with pkgs; [           # Default packages installed system-wide
      alsa-utils
      jq


@@ 159,10 158,6 @@
  nixpkgs.config.allowUnfree = true;        # Allow proprietary software.

  system = {                                # NixOS settings
    #autoUpgrade = {                         # Allow auto update (not useful in flakes)
    #  enable = true;
    #  channel = "https://nixos.org/channels/nixos-unstable";
    #};
    stateVersion = "22.05";
    stateVersion = "23.05";
  };
}

M hosts/default.nix => hosts/default.nix +7 -4
@@ 11,7 11,7 @@
#            └─ ./home.nix 
#

{ lib, inputs, nixpkgs, nixpkgs-unstable, home-manager, nur, user, location, doom-emacs, ... }:
{ lib, inputs, nixpkgs, nixpkgs-unstable, home-manager, doom-emacs, nur, user, location, ... }:

let
  system = "x86_64-linux";                                  # System architecture


@@ 53,7 53,7 @@ in
          };
        };
        home-manager.users.${user} = {
          imports = [(import ./home.nix)] ++ [(import ./laptop/home.nix)];
          imports = [doom-emacs.hmModule] ++ [(import ./home.nix)] ++ [(import ./laptop/home.nix)];
        };
      }
    ];


@@ 66,6 66,7 @@ in
      host = {
        hostName = "vm";
        mainMonitor = "Virtual-1";
        secondMonitor = "Virtual-2";
      };
    };
    modules = [


@@ 80,10 81,11 @@ in
          host = {
            hostName = "vm";
            mainMonitor = "Virtual-1";
            secondMonitor = "Virtual-2";
          };
        };
        home-manager.users.${user} = {
          imports = [(import ./home.nix)] ++ [(import ./vm/home.nix)];
          imports = [doom-emacs.hmModule] ++ [(import ./home.nix)] ++ [(import ./vm/home.nix)];
        };
      }
    ];


@@ 108,7 110,7 @@ in
        home-manager.useGlobalPkgs = true;
        home-manager.useUserPackages = true;
        home-manager.extraSpecialArgs = {
          inherit unstable user doom-emacs;
          inherit unstable user;
          host = {
            hostName = "desktop";       #For Xorg iGPU  | Hyprland iGPU
            mainMonitor = "HDMI-A-1";   #HDMIA3         | HDMI-A-3


@@ 117,6 119,7 @@ in
        };                                                  # Pass flake variable
        home-manager.users.${user} = {
          imports = [
            doom-emacs.hmModule
            ./home.nix
            ./desktop/home.nix
          ];

M hosts/desktop/home.nix => hosts/desktop/home.nix +1 -1
@@ 16,7 16,7 @@
{
  imports =
    [
      ../../modules/desktop/hyprland/home.nix  # Window Manager
      ../../modules/desktop/gnome/home.nix  # Window Manager
    ];

  home = {                                # Specific packages for desktop

M hosts/home.nix => hosts/home.nix +3 -1
@@ 16,6 16,8 @@
{ 
  imports =                                   # Home Manager Modules
    (import ../modules/programs) ++
    (import ../modules/shell/home.nix) ++
    (import ../modules/editors/home.nix) ++
    (import ../modules/services);

  home = {


@@ 106,7 108,7 @@
      #deluge           # Torrents
      discord           # Chat
      telegram-desktop  # Chat
      cinny-desktop     # Chat
      unstable.cinny-desktop     # Chat
      ffmpeg           # Video Support (dslr)
      #gmtp             # Mount MTP (GoPro)
      #gphoto2          # Digital Photography

M hosts/vm/default.nix => hosts/vm/default.nix +1 -1
@@ 26,7 26,7 @@
    loader = {                                  # For legacy boot
      grub = {
        enable = true;
        device = "/dev/sda";                    # Name of hard drive (can also be vda)
        device = "/dev/vda";                    # Name of hard drive (can also be vda)
      };
      timeout = 1;                              # Grub auto select timeout
    };

M hosts/vm/home.nix => hosts/vm/home.nix +0 -1
@@ 17,7 17,6 @@
  imports =
    [
      ../../modules/desktop/gnome/home.nix  #Window Manager
      ../../modules/editors/emacs/home.nix  #Doom emacs
    ];

  home = {                                  # Specific packages for desktop

M modules/desktop/gnome/default.nix => modules/desktop/gnome/default.nix +0 -2
@@ 33,8 33,6 @@
    ];
  };

  services.pipewire.enable = false;

  environment = {
    systemPackages = with pkgs; [                 # Packages installed
      gnome.dconf-editor

M modules/desktop/gnome/home.nix => modules/desktop/gnome/home.nix +1 -1
@@ 35,7 35,7 @@
      color-scheme = "prefer-dark";
      enable-hot-corners = false;
      clock-show-weekday = true;
      gtk-theme = "Adwaita-dark";
      #gtk-theme = "Adwaita-dark";
    };
    "org/gnome/desktop/privacy" = {
      report-technical-problems = "false";

D modules/editors/emacs/default.nix => modules/editors/emacs/default.nix +0 -20
@@ 1,20 0,0 @@
#
# Personal Emacs config. Can be set up with vanilla nixos or with home-manager (see comments at bottom)
#
# flake.nix
#   ├─ ./hosts
#   │   └─ configuration.nix
#   └─ ./modules
#       └─ ./editors
#           └─ ./emacs
#               └─ default.nix *
#


{ config, pkgs, ... }:

{
  services.emacs = {
    enable = true;
  };
}

R modules/editors/emacs/.doom.d/config.el => modules/editors/emacs/doom.d/config.el +20 -20
@@ 243,26 243,26 @@
(setq rmh-elfeed-org-files (list "~/Documents/notes/org/elfeed.org"))

;; tree sitter and navigation
(setq treesit-language-source-alist
      '((rust "https://github.com/tree-sitter/tree-sitter-rust")
        (vhdl "https://github.com/alemuller/tree-sitter-vhdl")
        (python "https://github.com/tree-sitter/tree-sitter-python")))

(use-package! combobulate
  :preface (setq combobulate-key-prefix "SPC k"))

(setq major-mode-remap-alist
 '((yaml-mode . yaml-ts-mode)
   ;;(rust-mode . rust-ts-mode)
   ;;(rustic-mode . rust-ts-mode)
   (c-mode . c-ts-mode)
   ;;(vhdl-mode . vhdl-ts-mode)
   (bash-mode . bash-ts-mode)
   (js2-mode . js-ts-mode)
   (typescript-mode . typescript-ts-mode)
   (json-mode . json-ts-mode)
   (css-mode . css-ts-mode)
   (python-mode . python-ts-mode)))
;;(setq treesit-language-source-alist
;;      '((rust "https://github.com/tree-sitter/tree-sitter-rust")
;;        (vhdl "https://github.com/alemuller/tree-sitter-vhdl")
;;        (python "https://github.com/tree-sitter/tree-sitter-python")))

;;(use-package! combobulate
;;  :preface (setq combobulate-key-prefix "SPC k"))

;;(setq major-mode-remap-alist
;; '((yaml-mode . yaml-ts-mode)
;;   ;;(rust-mode . rust-ts-mode)
;;   ;;(rustic-mode . rust-ts-mode)
;;   (c-mode . c-ts-mode)
;;   ;;(vhdl-mode . vhdl-ts-mode)
;;   (bash-mode . bash-ts-mode)
;;   (js2-mode . js-ts-mode)
;;   (typescript-mode . typescript-ts-mode)
;;   (json-mode . json-ts-mode)
;;   (css-mode . css-ts-mode)
;;   (python-mode . python-ts-mode)))

;;(add-hook 'lsp-ui-mode
;;  (lambda ()

R modules/editors/emacs/.doom.d/custom.el => modules/editors/emacs/doom.d/custom.el +0 -0
R modules/editors/emacs/.doom.d/init.el => modules/editors/emacs/doom.d/init.el +0 -0
R modules/editors/emacs/.doom.d/packages.el => modules/editors/emacs/doom.d/packages.el +0 -0
M modules/editors/emacs/home.nix => modules/editors/emacs/home.nix +17 -26
@@ 1,7 1,5 @@
#
# Doom Emacs: Personally not a fan of github:nix-community/nix-doom-emacs due to performance issues
# This is an ideal way to install on a vanilla NixOS installion.
# You will need to import this from somewhere in the flake (Obviously not in a home-manager nix file)
# Personal Emacs config. Can be set up with vanilla nixos or with home-manager (see comments at bottom)
#
# flake.nix
#   ├─ ./hosts


@@ 9,34 7,27 @@
#   └─ ./modules
#       └─ ./editors
#           └─ ./emacs
#               └─ ./doom-emacs
#                   └─ ./alt
#                       └─ native.nix *
#               └─ default.nix *
#


{ pkgs, ... }:
{ config, user, unstable, pkgs, doom-emacs, location, ... }:

let
  doom-emacs = pkgs.callPackage (builtins.fetchTarball {
    url = https://github.com/vlaci/nix-doom-emacs/archive/master.tar.gz;
    sha256 = "1sczbw6q80l5qasbkp0lnsw8zsh79xg2prhnpv8qxn4zih72kx73";
  }) {
    doomPrivateDir = ./doom.d;  # Directory containing your config.el init.el
                                # and packages.el files
  };
  emacs-with-packages = ((pkgs.emacsPackagesFor pkgs.emacs29).emacsWithPackages (epkgs: [
      epkgs.vterm
      epkgs.sqlite
      epkgs.treesit-grammars.with-all-grammars
    ]));
in {
  home.packages = [ doom-emacs ];
  home.file.".emacs.d/init.el".text = ''
      (load "default.el")
  '';

  programs.emacs.package = doom-emacs;
  services.emacs = {
    enable = true;
    package = emacs-with-packages;
  };

  environment.systemPackages = with pkgs; [
    ripgrep
    coreutils
    fd
    git
  ];
  programs.doom-emacs = {
    enable = true;
    doomPrivateDir = ./doom.d;
    emacsPackage = emacs-with-packages;
  };
}

R modules/editors/default.nix => modules/editors/home.nix +2 -2
@@ 11,8 11,8 @@
#

[
  ./emacs
  ./nvim
  ./emacs/home.nix
  ./nvim/home.nix
]

# Comment out emacs if you are not using native doom emacs. (import from host configuration.nix)

D modules/editors/nvim/default.nix => modules/editors/nvim/default.nix +0 -50
@@ 1,50 0,0 @@
#
# Neovim
#

{ pkgs, ... }:

{
  programs = {
    neovim = {
      enable = true;
      viAlias = true;
      vimAlias = true;

      configure = {
        customRC = ''
          syntax enable
          colorscheme srcery

          let g:lightline = {
            \ 'colorscheme': 'wombat',
            \ }

          highlight Comment cterm=italic gui=italic
          hi Normal guibg=NONE ctermbg=NONE

          set number

          nmap <F6> :NERDTreeToggle<CR>
        '';
        packages.myVimPackages = with pkgs.vimPlugins; {
          start = [
            vim-nix
            vim-markdown

            vim-lastplace
            auto-pairs
            vim-gitgutter

            nerdtree
            wombat256-vim
            srcery-vim

            lightline-vim
            indent-blankline-nvim
           ];
        };
      };
    };
  };
}

M modules/editors/nvim/home.nix => modules/editors/nvim/home.nix +10 -14
@@ 12,24 12,22 @@
      vimAlias = true;

      plugins = with pkgs.vimPlugins; [
        # Syntax
        vim-nix
        vim-markdown

        # Quality of life
        vim-lastplace         # Opens document where you left it
        auto-pairs            # Print double quotes/brackets/etc
        vim-gitgutter         # See uncommitted changes of file :GitGutterEnable
        vim-lastplace
        auto-pairs
        vim-gitgutter

        # File Tree
        nerdtree              # File Manager - set in extraConfig to F6
        wombat256-vim
        srcery-vim

        # Customization
        wombat256-vim         # Color scheme for lightline
        srcery-vim            # Color scheme for text
        lightline-vim
        indent-blankline-nvim

        lightline-vim         # Info bar at bottom
        indent-blankline-nvim # Indentation lines
        nvim-surround
        vim-easymotion
        vim-sneak
      ];

      extraConfig = ''


@@ 44,8 42,6 @@
        hi Normal guibg=NONE ctermbg=NONE         " Remove background, better for personal theme

        set number                                " Set numbers

        nmap <F6> :NERDTreeToggle<CR>             " F6 opens NERDTree
      '';
    };
  };

M modules/hardware/default.nix => modules/hardware/default.nix +0 -1
@@ 11,6 11,5 @@
#               └─ ...
#
[
  #./dslr.nix
  ./bluetooth.nix
]

M modules/shell/direnv.nix => modules/shell/direnv.nix +4 -21
@@ 11,27 11,10 @@
{ config, lib, pkgs, ... }:

{
  programs = lib.mkIf (config.programs.zsh.enable) {
    zsh = {
      shellInit = ''
        emulate zsh -c "$(direnv hook zsh)"
      '';
  programs = {
    direnv = {
      enable = true;
      nix-direnv.enable = true;
    };
  };

  environment = {
    systemPackages = with pkgs; [ direnv nix-direnv ];
    pathsToLink = [
      "/share/nix-direnv"
    ];
  };

  nix.settings = {
    keep-outputs = true;
    keep-derivations = true;
  };

  nixpkgs.overlays = [
    (self: super: { nix-direnv = super.nix-direnv.override { enableFlakes = true; }; } )
  ];
}

R modules/shell/default.nix => modules/shell/home.nix +0 -0
M modules/shell/zsh.nix => modules/shell/zsh.nix +7 -14
@@ 6,27 6,20 @@

{
  programs = {
    starship = {
      enable = true;
    };
    zsh = {
      enable = true;
      autosuggestions.enable = true;            # Auto suggest options and highlights syntax, searches in history for options
      syntaxHighlighting.enable = true;
      enableAutosuggestions = true;
      enableSyntaxHighlighting = true;
      enableCompletion = true;
      histSize = 100000;
      history.size = 100000;

      ohMyZsh = {                               # Extra plugins for zsh
      oh-my-zsh = {                               # Extra plugins for zsh
        enable = true;
        plugins = [ "git" ];
      };

      shellInit = ''                            # Zsh theme
        # Spaceship
        source ${pkgs.spaceship-prompt}/share/zsh/site-functions/prompt_spaceship_setup
        autoload -U promptinit; promptinit
        # Hook direnv
        #emulate zsh -c "$(direnv hook zsh)"

        #eval "$(direnv hook zsh)"
      '';
    };
  };
}

Do not follow this link