mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 02:55:38 +00:00
add basic nix flake template
This commit is contained in:
parent
e9fef7dbbb
commit
79f8e621e6
@ -85,6 +85,10 @@
|
||||
|
||||
# Templates for starting other projects quickly
|
||||
templates = {
|
||||
basic = {
|
||||
path = ./templates/basic;
|
||||
description = "Basic program template";
|
||||
};
|
||||
poetry = {
|
||||
path = ./templates/poetry;
|
||||
description = "Poetry template";
|
||||
|
1
templates/basic/.envrc
Normal file
1
templates/basic/.envrc
Normal file
@ -0,0 +1 @@
|
||||
use flake
|
27
templates/basic/flake.lock
Normal file
27
templates/basic/flake.lock
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1659803779,
|
||||
"narHash": "sha256-+5zkHlbcbFyN5f3buO1RAZ9pH1wXLxCesUJ0vFmLr9Y=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f44884060cb94240efbe55620f38a8ec8d9af601",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
19
templates/basic/flake.nix
Normal file
19
templates/basic/flake.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
description = "Basic project";
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
forAllSystems = nixpkgs.lib.genAttrs [
|
||||
"x86_64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
in {
|
||||
devShells = forAllSystems (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
in {
|
||||
default = pkgs.mkShell { buildInputs = with pkgs; [ nixfmt ]; };
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user