From c50ed8a90130a6f2f9e777dc14ac7ec4aec95010 Mon Sep 17 00:00:00 2001 From: Adam Gausmann Date: Wed, 28 Aug 2024 11:07:30 -0500 Subject: [PATCH] Nix project skeleton --- .gitignore | 3 ++ flake.lock | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 37 +++++++++++++++ home.nix | 14 ++++++ justfile | 10 ++++ 5 files changed, 196 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home.nix create mode 100644 justfile diff --git a/.gitignore b/.gitignore index 4d43b8e..9c0e3ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ # Python bytecode __pycache__ *.pyc + +# home-manager output +/result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..534e766 --- /dev/null +++ b/flake.lock @@ -0,0 +1,132 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720607326, + "narHash": "sha256-0Bpp15EMSP+Q/4TyIS/tQnKU5ZjbZGDtxoQFu+ddqCY=", + "owner": "exzombie", + "repo": "home-manager-smona", + "rev": "ff5bf3f36ebd59dec42b00dad40e195ae8818ee4", + "type": "github" + }, + "original": { + "owner": "exzombie", + "ref": "nixgl-compat", + "repo": "home-manager-smona", + "type": "github" + } + }, + "nixGL": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1713543440, + "narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", + "owner": "nix-community", + "repo": "nixGL", + "rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixGL", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1660551188, + "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1724242322, + "narHash": "sha256-HMpK7hNjhEk4z5SFg5UtxEio9OWFocHdaQzCfW1pE7w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "224042e9a3039291f22f4f2ded12af95a616cca0", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-24.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "home-manager": "home-manager", + "nixGL": "nixGL", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3776233 --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-24.05"; + + flake-utils.url = "github:numtide/flake-utils"; + + home-manager = { + url = "github:exzombie/home-manager-smona/nixgl-compat"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixGL.url = "github:nix-community/nixGL"; + }; + + outputs = { nixpkgs, flake-utils, home-manager, nixGL, ... } @ inputs: + flake-utils.lib.eachSystem (with flake-utils.lib.system; [ + x86_64-linux + ]) (system: + let + lib = nixpkgs.lib; + pkgs = import nixpkgs { + inherit system; + overlays = [ nixGL.overlay ]; + }; + in { + packages.homeConfigurations = { + goose = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ ./home.nix ]; + extraSpecialArgs = { + inherit inputs; + }; + }; + }; + } + ); +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..0b06707 --- /dev/null +++ b/home.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: { + home = { + stateVersion = "24.05"; + + username = "goose"; + homeDirectory = "/home/goose"; + + packages = with pkgs; [ + # fira-mono + ]; + }; + + # programs.home-manager.enable = true; +} diff --git a/justfile b/justfile new file mode 100644 index 0000000..5aab52a --- /dev/null +++ b/justfile @@ -0,0 +1,10 @@ +hm_flags := "--flake .#goose" + +alias b := build +alias inst := install + +build: + home-manager build {{hm_flags}} + +install: + home-manager switch {{hm_flags}}