From 823500e9819ce603edf8d8cb0c1cfdd515de9642 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Thu, 13 Apr 2023 21:30:17 +0200 Subject: [PATCH 1/2] include home-manager channel --- flake.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index f60b817..112b561 100644 --- a/flake.nix +++ b/flake.nix @@ -1,15 +1,26 @@ { description = "NixOS system flake"; - inputs = { + inputs = + { nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + home-manager = { + url = "github:nix-community/home-manager/release-22.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, ... }@inputs: { + outputs = + { self, nixpkgs, ... }@inputs: + #let + # system = "x86_64-linux"; + #in + { nixosConfigurations.thinknix = nixpkgs.lib.nixosSystem { + #inherit system; system = "x86_64-linux"; modules = [ ./nixos/configuration.nix ]; # necessary to make the top-level inputs available to system configuration From c568b8dc243ad6745b2966898bf94e08264b3a23 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Fri, 14 Apr 2023 01:56:52 +0200 Subject: [PATCH 2/2] flake-ify home-manager config with NUR and overlays --- flake.nix | 42 ++++++++++++++++++++++++++++++++++-------- home/config.nix | 7 ++----- home/home.nix | 19 +++++++++---------- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/flake.nix b/flake.nix index 112b561..4d5b7d3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,7 @@ { description = "NixOS system flake"; - inputs = - { + inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; @@ -10,21 +9,48 @@ url = "github:nix-community/home-manager/release-22.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + nur.url = "github:nix-community/NUR"; + # TODO: possible make this a flake as well + mysecrets = { + flake = false; + url = "git+ssh://gitea@git.orlives.de:2342/schmittlauch/home-manager_secrets.git"; + }; + }; outputs = - { self, nixpkgs, ... }@inputs: - #let - # system = "x86_64-linux"; - #in + { self, nixpkgs, nur, ... }@inputs: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { nixosConfigurations.thinknix = nixpkgs.lib.nixosSystem { - #inherit system; - system = "x86_64-linux"; + inherit system; modules = [ ./nixos/configuration.nix ]; # necessary to make the top-level inputs available to system configuration specialArgs = { inherit inputs; }; }; + homeConfigurations.spiollinux = inputs.home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + modules = [ + { + imports = [ + nur.hmModules.nur + ./home/home.nix + ]; + # extends the home config + home.username = "spiollinux"; + home.homeDirectory = "/home/spiollinux"; + } + ]; + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + extraSpecialArgs = { + inherit inputs; + }; + }; }; } diff --git a/home/config.nix b/home/config.nix index cd50baa..66a4143 100644 --- a/home/config.nix +++ b/home/config.nix @@ -1,8 +1,5 @@ -let - lib = (import {}).lib; - -in - { +{ lib, ...}: +{ firefox.enablePlasmaBrowserIntegration = true; firefox-bin.enablePlasmaBrowserIntegration = true; diff --git a/home/home.nix b/home/home.nix index dbc5007..9a87b78 100644 --- a/home/home.nix +++ b/home/home.nix @@ -1,12 +1,9 @@ -{ pkgs, ... }: +{ pkgs, inputs, config, ... }: with pkgs; let # nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable - unstable = import { }; - # nix-channel --add https://github.com/nix-community/NUR/archive/master.tar.gz NUR - nur = import { inherit pkgs; }; - myNur = nur.repos.schmittlauch; + unstable = inputs.nixos-unstable; desktopApps = [ firefox @@ -122,7 +119,7 @@ let reptyr # re-bind running program to other tty xclip unzip - myNur.lolcommits # from NUR + config.nur.repos.schmittlauch.lolcommits # from NUR ]; nixHelpers = [ @@ -248,7 +245,7 @@ let (iosevka-bin.override { variant = "curly-slab"; }) - myNur.vollkorn + config.nur.repos.schmittlauch.vollkorn # TODO: humor-sans ]; @@ -260,6 +257,8 @@ let in { + nixpkgs.overlays = (import ./overlays.nix); + home.packages = desktopApps ++ latexApps @@ -276,7 +275,7 @@ in programs.home-manager.enable = true; programs.home-manager.path = "$HOME/.nix-defexpr/channels/home-manager"; - home.stateVersion = "18.09"; + home.stateVersion = "22.11"; programs.direnv = { @@ -302,7 +301,7 @@ in enable = true; # ssh host config matchBlocks = - import ./secrets/ssh_hosts.nix; + import "${inputs.mysecrets}/ssh_hosts.nix"; }; programs.tmux = { @@ -331,7 +330,7 @@ in fonts.fontconfig.enable = true; programs.git = - let contacts = import ./secrets/contacts.nix; + let contacts = import "${inputs.mysecrets}/contacts.nix"; in { enable = true;