Compare commits

...

2 commits
2.0.0 ... main

Author SHA1 Message Date
DashieTM f229ed7dea Update nix packages
Some checks failed
Rust-build / Build (push) Has been cancelled
2025-02-15 16:17:06 +01:00
DashieTM f09ed75581 Use nix CI
Some checks failed
Rust-build / Build (push) Has been cancelled
2024-12-03 23:31:22 +01:00
6 changed files with 98 additions and 124 deletions

View file

@ -1 +1 @@
flake-profile-11-link flake-profile-4-link

View file

@ -1 +0,0 @@
/nix/store/51yb1yhqssknlmxvvscvj0cqbvs0z915-nix-shell-env

View file

@ -0,0 +1 @@
/nix/store/30prmd5nyydss0bcs7d578grjav6i7x3-nix-shell-env

View file

@ -1,25 +1,33 @@
name: Rust # inspired by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml
name: Rust-build
on: on:
push: push:
branches: [ "main" ] branches: ["main"]
pull_request: pull_request:
branches: [ "main" ] branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs: jobs:
build: build:
runs-on: [self-hosted, ubuntu] name: Build
permissions:
contents: read
runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - name: Install Nix
- name: nightly-rust uses: DeterminateSystems/nix-installer-action@main
uses: actions-rs/toolchain@v1
with: with:
profile: minimal github-token: ${{ secrets.GITHUB_TOKEN }}
toolchain: nightly extra-conf: |
extra-experimental-features = nix-command flakes
- name: Set up cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: action
uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: cache
uses: cachix/cachix-action@v14
with:
name: reset
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build - name: Build
run: cargo build --verbose run: nix -L build github:${{ github.repository }}/${{ github.sha }} --no-write-lock-file
- name: Run clippy
run: cargo clippy --fix

View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1715865404, "lastModified": 1738453229,
"narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,31 +20,13 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1716137900, "lastModified": 1739446958,
"narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", "narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6c0b7a92c30122196a761b440ac0d46d3d9954f1", "rev": "2ff53fe64443980e139eaa286017f53f88336dd0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -56,11 +38,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1706487304, "lastModified": 1736320768,
"narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", "narHash": "sha256-nIYdTAiKIGnFNugbomgBJR+Xv5F1ZQU+HfaBqJKroC0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", "rev": "4bc9c909d9ac828a039f288cf872d16d38185db8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -79,15 +61,14 @@
}, },
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1716171463, "lastModified": 1739586408,
"narHash": "sha256-lc7wOh5BjYUoxdhcPkeUY8BmuL2qtRaHlW1403RW48E=", "narHash": "sha256-UN9hRKRE1eLU8C0cioTZubaCZQTA8NDc8/4vCpS5pS0=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "04d61d14803854fd8453ec43c5c53a471e5407a8", "rev": "3dbc0ce1c0690b83cfb9a9a51fbe90c3bc8f9916",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -95,21 +76,6 @@
"repo": "rust-overlay", "repo": "rust-overlay",
"type": "github" "type": "github"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -1,69 +1,69 @@
{ rustPlatform {
, rust-bin rustPlatform,
, pulseaudio rust-bin,
, dbus pulseaudio,
, gdk-pixbuf dbus,
, gnome gdk-pixbuf,
, pkg-config adwaita-icon-theme,
, wrapGAppsHook4 pkg-config,
, gtk4 wrapGAppsHook4,
, libadwaita gtk4,
, python312Packages libadwaita,
, flatpak python312Packages,
, flatpak-builder flatpak,
, lib flatpak-builder,
, lockFile lib,
, ... lockFile,
}: ...
let }: let
cargoToml = builtins.fromTOML (builtins.readFile ../Cargo.toml); cargoToml = builtins.fromTOML (builtins.readFile ../Cargo.toml);
in in
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "ReSet"; pname = "ReSet";
version = cargoToml.package.version; version = cargoToml.package.version;
src = ../.; src = ../.;
buildInputs = [ buildInputs = [
gtk4 gtk4
libadwaita libadwaita
pulseaudio pulseaudio
dbus dbus
gdk-pixbuf gdk-pixbuf
gnome.adwaita-icon-theme adwaita-icon-theme
python312Packages.aiohttp python312Packages.aiohttp
python312Packages.toml python312Packages.toml
flatpak flatpak
flatpak-builder flatpak-builder
]; ];
cargoLock = { cargoLock = {
inherit lockFile; inherit lockFile;
}; };
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config pkg-config
wrapGAppsHook4 wrapGAppsHook4
rust-bin.nightly."2024-05-10".default rust-bin.nightly."2024-05-10".default
]; ];
copyLibs = true; copyLibs = true;
postInstall = '' postInstall = ''
install -D --mode=444 $src/${pname}.desktop $out/share/applications/${pname}.desktop install -D --mode=444 $src/${pname}.desktop $out/share/applications/${pname}.desktop
install -D --mode=444 $src/src/resources/icons/${pname}.svg $out/share/pixmaps/${pname}.svg install -D --mode=444 $src/src/resources/icons/${pname}.svg $out/share/pixmaps/${pname}.svg
''; '';
# test is broken in nix for some reason # test is broken in nix for some reason
doInstallCheck = false; doInstallCheck = false;
doCheck = false; doCheck = false;
meta = with lib; { meta = with lib; {
description = "A wip universal Linux settings application."; description = "A wip universal Linux settings application.";
homepage = "https://github.com/Xetibo/ReSet"; homepage = "https://github.com/Xetibo/ReSet";
changelog = "https://github.com/Xetibo/ReSet/releases/tag/${version}"; changelog = "https://github.com/Xetibo/ReSet/releases/tag/${version}";
license = licenses.gpl3; license = licenses.gpl3;
maintainers = with maintainers; [ DashieTM ]; maintainers = with maintainers; [DashieTM];
mainProgram = "ReSet"; mainProgram = "ReSet";
}; };
} }