Nix package export

This commit is contained in:
kalle 2025-06-23 16:15:46 +02:00
parent 9080e512c3
commit 6774bef64c
3 changed files with 51 additions and 230 deletions

207
flake.lock generated
View file

@ -1,210 +1,6 @@
{
"nodes": {
"cachix": {
"inputs": {
"devenv": [
"devenv"
],
"flake-compat": [
"devenv"
],
"git-hooks": [
"devenv",
"git-hooks"
],
"nixpkgs": [
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1748883665,
"narHash": "sha256-R0W7uAg+BLoHjMRMQ8+oiSbTq8nkGz5RDpQ+ZfxxP3A=",
"owner": "cachix",
"repo": "cachix",
"rev": "f707778d902af4d62d8dd92c269f8e70de09acbe",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "latest",
"repo": "cachix",
"type": "github"
}
},
"devenv": {
"inputs": {
"cachix": "cachix",
"flake-compat": "flake-compat",
"git-hooks": "git-hooks",
"nix": "nix",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1750437384,
"narHash": "sha256-3m00pI4ZdYDenFSKeWfMNjM0npdoHu5ssWRW+n577Fk=",
"owner": "cachix",
"repo": "devenv",
"rev": "3bd127d022e00c6656440732a1839df6798ac946",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"devenv",
"nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1749636823,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "623c56286de5a3193aa38891a6991b28f9bab056",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"devenv",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nix": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"flake-parts": "flake-parts",
"git-hooks-nix": [
"devenv",
"git-hooks"
],
"nixpkgs": "nixpkgs",
"nixpkgs-23-11": [
"devenv"
],
"nixpkgs-regression": [
"devenv"
]
},
"locked": {
"lastModified": 1750117611,
"narHash": "sha256-LTwASICtyN3AjzlF9l2ZNAIVZqclio3yRcwwZy3QSJA=",
"owner": "cachix",
"repo": "nix",
"rev": "9e4fc95c388e2223d47da865503dee20d179776a",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "devenv-2.30",
"repo": "nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1747179050,
"narHash": "sha256-qhFMmDkeJX9KJwr5H32f1r7Prs7XbQWtO0h3V0a0rFY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "adaa24fbf46737f3f1b5497bf64bae750f82942e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1746807397,
"narHash": "sha256-zU2z0jlkJGWLhdNr/8AJSxqK8XD0IlQgHp3VZcP56Aw=",
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "c5208b594838ea8e6cca5997fbf784b7cca1ca90",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1750215678,
"narHash": "sha256-Rc/ytpamXRf6z8UA2SGa4aaWxUXRbX2MAWIu2C8M+ok=",
@ -222,8 +18,7 @@
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},

View file

@ -2,7 +2,6 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
devenv.url = "github:cachix/devenv";
};
nixConfig = {
@ -12,19 +11,24 @@
outputs =
{
self,
systems,
nixpkgs,
devenv,
...
}@inputs:
}:
let
eachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
packages = eachSystem (system: {
devenv-up = self.devShells.${system}.default.config.procfileScript;
});
rec {
packages = eachSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
default = pkgs.callPackage ./nix/package.nix { };
application-launcher = default;
}
);
devShells = eachSystem (
system:
@ -32,23 +36,23 @@
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
(
{ pkgs, ... }:
{
dotenv.disableHint = true;
default = pkgs.mkShell {
# Copy build inputs from package
buildInputs = packages.${system}.default.buildInputs;
nativeBuildInputs =
# Copy native build inputs from package
packages.${system}.default.nativeBuildInputs
++ (with pkgs; [
# Additional packages for development
rustc
rustfmt
cargo
rust-analyzer
clippy
]);
languages.rust.enable = true;
packages = with pkgs; [
gtk4
gtk4-layer-shell
];
}
)
];
# Needed for rust-analyzer to find the rust standard library
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
}
);

22
nix/package.nix Normal file
View file

@ -0,0 +1,22 @@
{
rustPlatform,
gtk4,
gtk4-layer-shell,
pkg-config,
}:
rustPlatform.buildRustPackage rec {
pname = "application-launcher";
version = "0.1.0";
src = ./..;
nativeBuildInputs = [
pkg-config
];
buildInputs = [
gtk4
gtk4-layer-shell
];
cargoHash = "sha256-KgixCJMtDoIe2JIVrkk5HCnaca2sZSuOREOXC1othXk=";
}