Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
Dmitry Voronin | b6be777855 | ||
Dmitry Voronin | a39257e8fd | ||
Dmitry Voronin | b2dbb6ff9e | ||
Dmitry Voronin | 894a69222c |
25
Readme.md
Normal file
25
Readme.md
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# NixOS Sample package.
|
||||||
|
|
||||||
|
## How to build.
|
||||||
|
|
||||||
|
```text
|
||||||
|
nix build
|
||||||
|
```
|
||||||
|
|
||||||
|
## How to integrate into the system (flakes).
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
sampleapp.url = "git+https://git.voronind.com/voronind/template_nixos_package.git";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
inputs.sampleapp.packages.${pkgs.system}.default
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
27
flake.lock
Normal file
27
flake.lock
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1707092692,
|
||||||
|
"narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "faf912b086576fd1a15fca610166c98d47bc667e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
20
flake.nix
20
flake.nix
|
@ -5,23 +5,25 @@
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, stdenv } @inputs:
|
outputs = { self, nixpkgs } @inputs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
lib = pkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
in {
|
in {
|
||||||
packages.${system}.default = {
|
packages.${system}.default = pkgs.stdenv.mkDerivation rec {
|
||||||
pname = "Sample Package";
|
pname = "Sample Package";
|
||||||
version = "1.0";
|
version = "1.0";
|
||||||
|
|
||||||
# Fetch sources.
|
# Fetch sources.
|
||||||
src = fetchGit {
|
src = inputs.self;
|
||||||
url = "https://git.voronind.com/voronind/nixos_sample_package.git";
|
# src = pkgs.fetchurl {
|
||||||
};
|
# url = "https://git.voronind.com/voronind/nixos_sample_package/archive/v1.tar.gz";
|
||||||
|
# hash = "sha256-zAXcCiRqOgMBChqabFjCmAaux1Yb9N+Y5jcE22zT3OI=";
|
||||||
|
# };
|
||||||
|
|
||||||
# Bins go here.
|
# Bins go here.
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = with pkgs; [
|
||||||
cargo
|
cargo
|
||||||
rustc
|
rustc
|
||||||
];
|
];
|
||||||
|
@ -36,8 +38,8 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p ${out}/bin
|
mkdir -p $out/bin
|
||||||
cp target/release/nixos_sample_package ${out}/bin
|
cp target/release/nixos_sample_package $out/bin
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue