From 206bd48fb228e860e6e64b2e4267f77cf1985676 Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Fri, 28 Jun 2024 00:49:04 +0200 Subject: [PATCH] nixos: add home-manager --- nixos/msi/configuration.nix | 36 ++++++++++------- nixos/msi/home.nix | 77 ++++++++++++++++++++++++------------- 2 files changed, 73 insertions(+), 40 deletions(-) diff --git a/nixos/msi/configuration.nix b/nixos/msi/configuration.nix index b450722..5b3d77b 100644 --- a/nixos/msi/configuration.nix +++ b/nixos/msi/configuration.nix @@ -12,10 +12,12 @@ let wget gnumake gcc - nodejs_22 - # Language servers + # Lua + (luajit.withPackages (p: with p; [ luarocks ])) lua-language-server + + # Nix nixd # Neovim @@ -30,11 +32,11 @@ let in { imports = - [ # Include the results of the hardware scan. + [ + ./hardware-configuration.nix ./nvidia.nix ./boot.nix - ./home.nix ./gaming.nix ]; @@ -119,26 +121,34 @@ in # started in user sessions. # programs.mtr.enable = true; programs = { + fish.enable = true; gnupg = { agent = { enable = true; enableSSHSupport = true; }; }; - fish.enable = true; - git = { + firefox = { enable = true; - config = { - user.name = "Maciej Jur"; - user.email = "maciej@kamoshi.org"; - user.signingkey = "191CBFF5F72ECAFD!"; - commit.gpgsign = true; - init.defaultBranch = "main"; - core.editor = "vim"; + package = pkgs.firefox-devedition; + preferences = { + "widget.use-xdg-desktop-portal.file-picker" = 1; + "widget.use-xdg-desktop-portal.mime-handler" = 1; }; }; }; + users.users.kamov = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable sudo + shell = pkgs.fish; + }; + + home-manager = { + useGlobalPkgs = true; + users.kamov = import ./home.nix; + }; + # List services that you want to enable: # Enable the OpenSSH daemon. diff --git a/nixos/msi/home.nix b/nixos/msi/home.nix index 90e616b..ea7721a 100644 --- a/nixos/msi/home.nix +++ b/nixos/msi/home.nix @@ -1,32 +1,55 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: let - unstable = import {}; - packages = (with pkgs; [ - anki - discord - krita - prismlauncher - qbittorrent - spotify - vlc - ]) ++ (with unstable; [ - neovide - ]); + unstable = import {}; + packages = (with pkgs; [ + anki + discord + krita + prismlauncher + qbittorrent + spotify + vlc + obs-studio + audacity + ]) ++ (with unstable; [ + neovide + ]); in { - programs.firefox = { - enable = true; - package = pkgs.firefox-devedition; - preferences = { - "widget.use-xdg-desktop-portal.file-picker" = 1; - "widget.use-xdg-desktop-portal.mime-handler" = 1; - }; - }; + home = { + # Home Manager needs a bit of information about you and the + # paths it should manage. + username = "kamov"; + homeDirectory = "/home/kamov"; - users.users.kamov = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable sudo - packages = packages; - shell = pkgs.fish; - }; + # Packages that should be installed to the user profile. + packages = packages; + }; + + programs = { + # default shell + fish.enable = true; + + git = { + enable = true; + userName = "Maciej Jur"; + userEmail = "maciej@kamoshi.org"; + signing = { + signByDefault = true; + key = "191CBFF5F72ECAFD!"; + }; + }; + }; + + services.kdeconnect.enable = true; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "24.05"; }