From 70485efd8665d3efe0a7f4d9597a63e7396ca2e0 Mon Sep 17 00:00:00 2001 From: BuyMyMojo Date: Tue, 25 Mar 2025 03:26:13 +1100 Subject: [PATCH] Move home-manager over to using flake --- home-manager/flake.lock | 66 +++++++++++++++++++++++++++++++++++++++++ home-manager/flake.nix | 49 ++++++++++++++++++++++++++++++ home-manager/home.nix | 12 ++------ 3 files changed, 118 insertions(+), 9 deletions(-) create mode 100644 home-manager/flake.lock create mode 100644 home-manager/flake.nix diff --git a/home-manager/flake.lock b/home-manager/flake.lock new file mode 100644 index 0000000..7e1db38 --- /dev/null +++ b/home-manager/flake.lock @@ -0,0 +1,66 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742655702, + "narHash": "sha256-jbqlw4sPArFtNtA1s3kLg7/A4fzP4GLk9bGbtUJg0JQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "0948aeedc296f964140d9429223c7e4a0702a1ff", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1742751704, + "narHash": "sha256-rBfc+H1dDBUQ2mgVITMGBPI1PGuCznf9rcWX/XIULyE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f0946fa5f1fb876a9dc2e1850d9d3a4e3f914092", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1742669843, + "narHash": "sha256-G5n+FOXLXcRx+3hCJ6Rt6ZQyF1zqQ0DL0sWAMn2Nk0w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1e5b653dff12029333a6546c11e108ede13052eb", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home-manager/flake.nix b/home-manager/flake.nix new file mode 100644 index 0000000..6df2540 --- /dev/null +++ b/home-manager/flake.nix @@ -0,0 +1,49 @@ +{ + description = "Home Manager configuration of buymymojo"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager/release-24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { + nixpkgs, + home-manager, + nixpkgs-unstable, + ... + }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + + unstable = import nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + }; + in + { + homeConfigurations."buymymojo" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit unstable; + }; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ ./home.nix ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; +} diff --git a/home-manager/home.nix b/home-manager/home.nix index b41d9a1..e9282be 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,11 +1,5 @@ -{ config, pkgs, ... }: -let - unstable = import { - config = { - allowUnfree = true; - }; - }; -in +{ config, pkgs, unstable, ... }: + { # Home Manager needs a bit of information about you and the paths it should # manage. @@ -27,7 +21,7 @@ in # The home.packages option allows you to install Nix packages into your # environment. - home.packages = [ + home.packages = with unstable; [ pkgs.nextcloud-client pkgs.yubioath-flutter pkgs.xpipe