diff options
| -rw-r--r-- | Program.cs | 2 | ||||
| -rw-r--r-- | flake.lock | 27 | ||||
| -rw-r--r-- | flake.nix | 69 | ||||
| -rw-r--r-- | hypr-wellbeing.csproj | 12 | ||||
| -rwxr-xr-x | nix-container.sh | 7 |
5 files changed, 110 insertions, 7 deletions
@@ -10,7 +10,7 @@ class Program { string os; - string version = "0.0.8"; + string version = "0.0.9"; string homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); string configDir = Path.Combine(homeDirectory, ".config", "hypr-wellbeing"); string configFile = Path.Combine(configDir, "config.json"); diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..682004d --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1776169885, + "narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4bd9165a9165d7b5e33ae57f3eecbcb28fb231c9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8ade55c --- /dev/null +++ b/flake.nix @@ -0,0 +1,69 @@ +{ +description = "hypr-wellbeing - An app usage logger for hyprland and niri"; + +inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + +outputs = { self, nixpkgs }: + let + systems = [ "x86_64-linux" ]; + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); + in + { + packages = forAllSystems (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + version = "0.0.9"; + + binaryName = { + "x86_64-linux" = "hypr-wellbeing"; + }.${system}; + + sha256 = { + "x86_64-linux" = "sha256-sem/XST8hSfyFGbAhnLXxFtkhp7uo9k91mL/sEIVBlM="; + }.${system}; + + in + { + hypr-wellbeing = pkgs.stdenvNoCC.mkDerivation { + pname = "hypr-wellbeing"; + inherit version; + + src = pkgs.fetchurl { + url = "https://github.com/DemonKingSwarn/hypr-wellbeing/releases/download/${version}/${binaryName}"; + inherit sha256; + }; + + dontUnpack = true; + dontBuild = true; + + nativeBuildInputs = [ pkgs.makeWrapper ]; + + propagatedBuildInputs = with pkgs; [ ]; + + installPhase = '' + install -Dm755 $src $out/bin/hypr-wellbeing + ''; + + meta = with pkgs.lib; { + description = "An app usage logger for hyprland and niri"; + homepage = "https://github.com/DemonKingSwarn/hypr-wellbeing"; + license = licenses.gpl3Only; + maintainers = [ ]; + platforms = [ "x86_64-linux" ]; + mainProgram = "hypr-wellbeing"; + }; + }; + + default = self.packages.${system}.hypr-wellbeing; + } + ); + + apps = forAllSystems (system: { + default = { + type = "app"; + program = "${self.packages.${system}.hypr-wellbeing}/bin/hypr-wellbeing"; + }; + }); + }; +} diff --git a/hypr-wellbeing.csproj b/hypr-wellbeing.csproj index 9092bd9..9aef20e 100644 --- a/hypr-wellbeing.csproj +++ b/hypr-wellbeing.csproj @@ -1,5 +1,4 @@ <Project Sdk="Microsoft.NET.Sdk"> - <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFramework> @@ -7,11 +6,12 @@ <Nullable>enable</Nullable> <PublishAot>true</PublishAot> <IsAotCompatible>true</IsAotCompatible> - <RuntimeIdentifier>linux-x64</RuntimeIdentifier> - </PropertyGroup> - + <RuntimeIdentifier>linux-musl-x64</RuntimeIdentifier> <!-- musl for static --> + <StaticExecutable>true</StaticExecutable> + <StripSymbols>true</StripSymbols> + <InvariantGlobalization>true</InvariantGlobalization> <!-- removes ICU dep --> + </PropertyGroup> <ItemGroup> - <PackageReference Include="Newtonsoft.json" Version="13.0.4" /> + <PackageReference Include="Newtonsoft.Json" Version="13.0.4" /> </ItemGroup> - </Project> diff --git a/nix-container.sh b/nix-container.sh new file mode 100755 index 0000000..44fd4fc --- /dev/null +++ b/nix-container.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +podman run -it --rm \ + -v "$PWD:/work" \ + -w /work \ + nixos/nix:latest \ + bash |
