From 622c443a60197651ec1dd19ed826d1d761f76cdd Mon Sep 17 00:00:00 2001 From: tristan Date: Wed, 12 Apr 2023 12:28:39 +0100 Subject: [PATCH] home-manager and stuff --- flake.nix | 9 +++-- system/configuration.nix | 78 ++++++++++++++++++++++++++++------------ users/tristan/home.nix | 44 +++-------------------- 3 files changed, 67 insertions(+), 64 deletions(-) diff --git a/flake.nix b/flake.nix index bb1d82a..4eb9370 100644 --- a/flake.nix +++ b/flake.nix @@ -27,10 +27,15 @@ hyprland.nixosModules.default {programs.hyprland.enable = true;} ./system/configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.tristan = { + imports = [ ./users/tristan/home.nix ]; + }; + } ]; }; - }; - }; } diff --git a/system/configuration.nix b/system/configuration.nix index 8774e33..2e0a675 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -17,12 +17,15 @@ nix.settings.trusted-users = [ "root" "tristan" ]; # Use the systemd-boot EFI boot loader. - boot.loader.grub.enable = true; - boot.loader.grub.version = 2; - boot.loader.grub.devices = ["nodev"]; - boot.loader.grub.useOSProber = true; + boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + # boot.loader.grub.enable = true; + # boot.loader.grub.version = 2; + # boot.loader.grub.devices = ["nodev"]; + # boot.loader.grub.useOSProber = true; + # boot.loader.efi.canTouchEfiVariables = true; + networking.hostName = "zenix"; networking.networkmanager.enable = true; @@ -50,12 +53,9 @@ # Configure graphical stuff services.xserver = { - enable = true; + enable = false; layout = "gb"; - xkbVariant = "dvorak"; libinput.enable = true; - - displayManager.lightdm.enable = true; }; qt5.enable = true; @@ -71,18 +71,56 @@ isNormalUser = true; extraGroups = [ "wheel" "video" ]; initialPassword = "pass"; - shell = pkgs.zsh; + shell = pkgs.fish; + }; + + environment.variables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + TERMINAL = "foot"; }; environment.systemPackages = with pkgs; [ + foot + brave tealdeer alsa-utils - neovim + tofi + waybar + swaylock-effects + bitwarden-cli + bitwarden + pcmanfm + pavucontrol + exa + (neovim.override { + vimAlias = true; + configure = { + packages.myPlugins = with pkgs.vimPlugins; { + start = [ vim-surround vim-commentary vim-nix ]; + opt = []; + }; + customRC = '' + vnoremap * y/\V=escape(@",'/\') + vnoremap "ry:%s/=escape(@r,'/\') + vnoremap A :norm A + set number + set rnu + set ignorecase + set smartcase + set mouse=a + set path=.,** + let g:netrw_banner=0 + let g:netrw_liststyle=3 + set undofile + set undodir=~/.local/share/nvim/undo + ''; + }; + }) ]; services.dbus.enable = true; programs.light.enable = true; - programs.zsh.enable = true; programs.dconf.enable = true; programs.hyprland = { enable = true; @@ -92,10 +130,10 @@ # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; # List services that you want to enable: @@ -110,18 +148,14 @@ # Or disable the firewall altogether. # networking.firewall.enable = false; + networking.firewall.checkReversePath = "loose"; + # Copy the NixOS configuration file and link it from the resulting system # (/run/current-system/configuration.nix). This is useful in case you # accidentally delete configuration.nix. # system.copySystemConfiguration = true; - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "22.11"; # Did you read the comment? } diff --git a/users/tristan/home.nix b/users/tristan/home.nix index f023f4a..8c6eba1 100644 --- a/users/tristan/home.nix +++ b/users/tristan/home.nix @@ -1,12 +1,5 @@ -{ config, pkgs, ... }: -let - doom-emacs = pkgs.callPackage (builtins.fetchTarball { - url = https://github.com/nix-community/nix-doom-emacs/archive/master.tar.gz; - }) { - doomPrivateDir = ./doom.d; # Directory containing your config.el, init.el - # and packages.el files - }; -in { +{ config, pkgs, user, ... }: +{ # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "tristan"; @@ -25,38 +18,9 @@ in { # Let Home Manager install and manage itself. programs.home-manager.enable = true; - home.packages = with pkgs; [ - brave - pcmanfm - lf - chafa - imv - mpv - mpvScripts.mpris - sway - swaylock - waybar - wofi - foot - neovim - git - neofetch - fusuma - ffmpeg - motion - trash-cli - tailscale - spotifyd - htop - mosh - tmux - doom-emacs - wget - wev + home.packages = with pkgs; [ gimp - thunderbird - nextcloud-client - ]; + ]; gtk = { enable = true;