From 9a856d3a5b1f2571a0b575b7476cfae6f0ca9437 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Thu, 18 May 2023 18:52:05 -0400 Subject: [PATCH] Nix... Nix home manager.. on MY Guix installation?? More likely than you'd think! --- home-config/bash_profile | 3 + home-config/home-configuration.scm | 8 +-- home-config/nix-channels | 2 + home-config/nix-home-manager/home.nix | 83 +++++++++++++++++++++++++++ system.scm | 3 +- 5 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 home-config/nix-channels create mode 100644 home-config/nix-home-manager/home.nix diff --git a/home-config/bash_profile b/home-config/bash_profile index 319a0ca..d58e435 100644 --- a/home-config/bash_profile +++ b/home-config/bash_profile @@ -4,5 +4,8 @@ export XDG_CURRENT_DESKTOP=sway export XDG_SESSION_DESKTOP=sway export _JAVA_AWT_WM_NONREPEATING=1 +export XDG_DATA_DIRS=$XDG_DATA_DIRS:~/.nix-profile/share +export PATH=$PATH:~/.nix-profile/bin + # Honor per-interactive-shell startup file if [ -f ~/.bashrc ]; then . ~/.bashrc; fi diff --git a/home-config/home-configuration.scm b/home-config/home-configuration.scm index 64d1236..10c8374 100644 --- a/home-config/home-configuration.scm +++ b/home-config/home-configuration.scm @@ -40,8 +40,6 @@ "lsof" "pavucontrol" "bind:utils" - "firefox" - "irssi" "font-cns11643" "syncthing" "perl" @@ -97,13 +95,15 @@ ("nvim/after/ftplugin/markdown/custom.vim" ,(local-file "nvim/config/after/ftplugin/markdown/custom.vim")) ("sway" ,(local-file "sway" #:recursive? #t)) ("waybar" ,(local-file "waybar" #:recursive? #t)) - ("alacritty" ,(local-file "alacritty" #:recursive? #t)) )) + ("alacritty" ,(local-file "alacritty" #:recursive? #t)) + ("home-manager" ,(local-file "nix-home-manager" #:recursive? #t)) )) (service home-files-service-type `((".local/share/nvim/site/autoload/plug.vim" ,(local-file "nvim/plugin-manager/plug.vim")) (".ssh/config" ,(local-file "ssh/config")) ;(".gnupg/sshcontrol" ,(local-file "gnupg/sshcontrol")) ;(".gnupg/gpg-agent.conf" ,(local-file "gnupg/gpg-agent.conf")) - (".fonts" ,(local-file "fonts" #:recursive? #t)))) + (".fonts" ,(local-file "fonts" #:recursive? #t)) + (".nix-channels" ,(local-file "nix-channels")))) (service home-pipewire-service-type) (service home-dbus-service-type) (service home-gpg-agent-service-type diff --git a/home-config/nix-channels b/home-config/nix-channels new file mode 100644 index 0000000..0df3852 --- /dev/null +++ b/home-config/nix-channels @@ -0,0 +1,2 @@ +https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager +https://nixos.org/channels/nixpkgs-unstable nixpkgs diff --git a/home-config/nix-home-manager/home.nix b/home-config/nix-home-manager/home.nix new file mode 100644 index 0000000..39a8c0e --- /dev/null +++ b/home-config/nix-home-manager/home.nix @@ -0,0 +1,83 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "ryan"; + home.homeDirectory = "/home/ryan"; + + # 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 should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "22.11"; # Please read the comment before changing. + + # This value will set some environment variables to allow home-manager to + # function better outside of NixOS + nixpkgs.config.allowUnfree = true; + targets.genericLinux.enable = true; + fonts.fontconfig.enable = true; + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs; [ + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello + firefox + dejavu_fonts + cantarell-fonts + liberation_ttf + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # You can also manage environment variables but you will have to manually + # source + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/ryan/etc/profile.d/hm-session-vars.sh + # + # if you don't want to manage your shell through Home Manager. + home.sessionVariables = { + # EDITOR = "emacs"; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/system.scm b/system.scm index c4a22cf..bd0dd2c 100644 --- a/system.scm +++ b/system.scm @@ -20,7 +20,7 @@ (use-modules (srfi srfi-1)) (use-modules (ryan-packages freedesktop)) (use-package-modules security-token) -(use-service-modules cups desktop networking xorg ssh sound security-token docker virtualization) +(use-service-modules cups desktop networking xorg ssh nix sound security-token docker virtualization) ; Define package that installs my root ca public keys (define my-ca-certs @@ -146,6 +146,7 @@ (service openssh-service-type) (service pcscd-service-type) (service docker-service-type) + (service nix-service-type) (service libvirt-service-type (libvirt-configuration (unix-sock-group "libvirt")))