generated from juspay/nixos-unified-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
70 lines (60 loc) · 2.45 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
description = "A home-manager template providing useful tools & settings for Nix-based development";
inputs = {
# Principle inputs (updated by `nix run .#update`)
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
nixos-flake.url = "github:srid/nixos-flake";
# see https://github.com/nix-systems/default/blob/main/default.nix
systems.url = "github:nix-systems/default";
};
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [
inputs.nixos-flake.flakeModule
];
flake.templates.default = {
description = "A `home-manager` template providing useful tools & settings for Nix-based development";
path = builtins.path {
path = ./.;
filter = path: _: with inputs.nixpkgs.lib;
!(hasSuffix "LICENSE" path ||
hasSuffix "README.md" path ||
hasSuffix "flake.lock" path);
};
};
perSystem = { self', pkgs, ... }:
let
# TODO: Change username
myUserName = "utkarsh.pandey1";
in
{
legacyPackages.homeConfigurations.${myUserName} =
inputs.self.nixos-flake.lib.mkHomeConfiguration
pkgs
({ pkgs, ... }: {
# Edit the contents of the ./home directory to install packages and modify dotfile configuration in your
# $HOME.
#
# https://nix-community.github.io/home-manager/index.html#sec-usage-configuration
imports = [ ./home ];
home.username = myUserName;
home.homeDirectory = "/${if pkgs.stdenv.isDarwin then "Users" else "home"}/${myUserName}";
home.stateVersion = "22.11";
});
formatter = pkgs.nixpkgs-fmt;
# Enables 'nix run' to activate.
apps.default.program = self'.packages.activate-home;
# Enable 'nix build' to build the home configuration, but without
# activating.
packages.default = self'.legacyPackages.homeConfigurations.${myUserName}.activationPackage;
devShells.default = pkgs.mkShell {
name = "nix-dev-home";
nativeBuildInputs = with pkgs; [ just ];
};
};
};
}