Flakifying

This commit is contained in:
Joe Frikker
2026-01-01 00:33:10 -05:00
parent 64c2ab2255
commit 84a9960357
3 changed files with 118 additions and 5 deletions

66
flake.nix Normal file
View File

@@ -0,0 +1,66 @@
{
description = "Home Manager configuration of Joe Frikker";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }:
let modules-for-system = pkgs: pkgs.stdenv.mkDerivation {
name = "home-manager-modules";
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./home.org
];
};
buildPhase = ''
runHook preBuild
${pkgs.emacs}/bin/emacs --batch --eval "(require 'org)" --eval '(org-babel-tangle-file "home.org")'
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -R target $out
runHook postInstall
'';
};
in {
homeConfigurations.shibumi =
let pkgs = nixpkgs.legacyPackages.aarch64-darwin;
modules = modules-for-system pkgs;
in home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
"${modules}/home.nix"
{
home.stateVersion = "22.05";
home.username = "jfrikker";
home.homeDirectory = "/Users/jfrikker";
}
];
};
homeConfigurations.home =
let pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = modules-for-system pkgs;
in home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
"${modules}/home.nix"
{
home.stateVersion = "22.05";
home.username = "jfrikker";
home.homeDirectory = "/home/jfrikker";
}
];
};
};
}