Last active
April 2, 2024 23:17
-
-
Save myme/bcf5c399fe5fa7c41b4fd4b3831da55d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; | |
outputs = { nixpkgs, ... }: | |
let | |
system = "x86_64-linux"; | |
pkgs = import nixpkgs { inherit system; }; | |
in { | |
packages.${system}.default = pkgs.stdenv.mkDerivation { | |
name = "dotfiles"; | |
src = builtins.fetchGit { | |
url = "https://github.com/myme/dotfiles"; | |
rev = "2fd5c02b2ac0f11c57cca3e9d8a5c5c1b381bb76"; | |
}; | |
installPhase = '' | |
cp -av $src $out | |
''; | |
}; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/tmp/nix-git-flake | |
01:16:05 ❯ cat flake.nix | |
{ | |
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; | |
outputs = { nixpkgs, ... }: | |
let | |
system = "x86_64-linux"; | |
pkgs = import nixpkgs { inherit system; }; | |
in { | |
packages.${system}.default = pkgs.stdenv.mkDerivation { | |
name = "dotfiles"; | |
src = builtins.fetchGit { | |
url = "https://github.com/myme/dotfiles"; | |
rev = "2fd5c02b2ac0f11c57cca3e9d8a5c5c1b381bb76"; | |
}; | |
installPhase = '' | |
cp -av $src $out | |
''; | |
}; | |
}; | |
} | |
~/tmp/nix-git-flake | |
01:16:06 ❯ nix build | |
~/tmp/nix-git-flake | |
01:16:44 ❯ ls -l | |
total 8 | |
-rw-r--r-- 1 myme users 564 Apr 3 01:14 flake.lock | |
-rw-r--r-- 1 myme users 517 Apr 3 01:16 flake.nix | |
lrwxrwxrwx 1 myme users 52 Apr 3 01:16 result -> /nix/store/wxmd2214ck0d14qh0ryiiqdgx3w0kzh2-dotfiles | |
~/tmp/nix-git-flake | |
01:16:47 ❯ ls -l result/ | |
total 68 | |
dr-xr-xr-x 2 root root 4096 Jan 1 1970 bootstrap | |
-r--r--r-- 1 root root 14298 Jan 1 1970 flake.lock | |
-r--r--r-- 1 root root 3832 Jan 1 1970 flake.nix | |
dr-xr-xr-x 5 root root 4096 Jan 1 1970 home-manager | |
dr-xr-xr-x 2 root root 4096 Jan 1 1970 lib | |
dr-xr-xr-x 5 root root 4096 Jan 1 1970 machines | |
-r--r--r-- 1 root root 1243 Jan 1 1970 nixon.md | |
-r--r--r-- 1 root root 975 Jan 1 1970 overlay.nix | |
dr-xr-xr-x 4 root root 4096 Jan 1 1970 pkgs | |
-r--r--r-- 1 root root 2050 Jan 1 1970 README.md | |
dr-xr-xr-x 2 root root 4096 Jan 1 1970 secrets | |
-r--r--r-- 1 root root 1212 Jan 1 1970 secrets.nix | |
dr-xr-xr-x 2 root root 4096 Jan 1 1970 system | |
dr-xr-xr-x 2 root root 4096 Jan 1 1970 users | |
~/tmp/nix-git-flake | |
01:16:50 ❯ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment