-
-
Notifications
You must be signed in to change notification settings - Fork 32
nix flake and darwin module #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GustavoWidman
wants to merge
11
commits into
acsandmann:main
Choose a base branch
from
GustavoWidman:feat/nix-compat
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6536b2e
feat: init nix modules
GustavoWidman a8d6338
feat: add nix overlay
GustavoWidman 8b9f693
chore: bump version to match github releases
GustavoWidman b1d07cc
fix: use default config that's already on repo
GustavoWidman 682ccad
feat: add nix release workflow
GustavoWidman 22ebc87
feat: add `rift-bin` package, no need for cache
GustavoWidman 595fd58
fix: merge workflows into one to use `needs` tag
GustavoWidman 9ad1151
patch: also update flake lockfile in case of release
GustavoWidman 8908869
fix: patch overlay to match new packages
GustavoWidman 6fab090
chore(flake): update inputs
GustavoWidman 3d877da
chore: update package version to match gh release
GustavoWidman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| [package] | ||
| name = "rift-wm" | ||
| version = "0.1.0" | ||
| version = "0.2.8-beta" | ||
| edition = "2024" | ||
| build = "build.rs" | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| description = "rift - a tiling window manager for macOS that focuses on performance and usability"; | ||
|
|
||
| inputs = { | ||
| nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
| fenix = { | ||
| url = "github:nix-community/fenix"; | ||
| inputs.nixpkgs.follows = "nixpkgs"; | ||
| }; | ||
| crane.url = "github:ipetkov/crane"; | ||
| flake-parts.url = "github:hercules-ci/flake-parts"; | ||
| devshell.url = "github:numtide/devshell"; | ||
| }; | ||
|
|
||
| outputs = | ||
| inputs@{ | ||
| flake-parts, | ||
| devshell, | ||
| ... | ||
| }: | ||
| flake-parts.lib.mkFlake { inherit inputs; } { | ||
| systems = [ | ||
| "aarch64-darwin" | ||
| "x86_64-darwin" | ||
| ]; | ||
| imports = [ | ||
| devshell.flakeModule | ||
| (import ./nix/package.nix inputs) | ||
| ./nix/module.nix | ||
| ]; | ||
| perSystem = | ||
| { ... }: | ||
| { | ||
| devshells.default = { | ||
| motd = ""; | ||
| }; | ||
| }; | ||
| } | ||
| // { | ||
| overlays.default = import ./nix/overlay.nix inputs; | ||
| }; | ||
| } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| { self, ... }: | ||
|
|
||
| { | ||
| flake.darwinModules.default = | ||
| { | ||
| config, | ||
| lib, | ||
| pkgs, | ||
| ... | ||
| }: | ||
| let | ||
| cfg = config.services.rift; | ||
|
|
||
| toml = pkgs.formats.toml { }; | ||
|
|
||
| configFile = | ||
| if cfg.config == null then | ||
| null | ||
| else if lib.isPath cfg.config || lib.isString cfg.config then | ||
| cfg.config | ||
| else | ||
| toml.generate "rift.toml" cfg.config; | ||
| in | ||
| { | ||
| options.services.rift = { | ||
| enable = lib.mkEnableOption "Enable rift window manager service"; | ||
|
|
||
| package = lib.mkOption { | ||
| type = lib.types.package; | ||
| default = self.packages.${pkgs.system}.default; | ||
| description = "rift (not rift-cli) package to use"; | ||
| }; | ||
|
|
||
| config = lib.mkOption { | ||
| type = | ||
| with lib.types; | ||
| oneOf [ | ||
| str | ||
| path | ||
| toml.type | ||
| null | ||
| ]; | ||
| description = "Configuration settings for rift. Also accepts paths (string or path type) to a config file."; | ||
| default = ../rift.default.toml; | ||
| }; | ||
| }; | ||
|
|
||
| config = lib.mkIf cfg.enable { | ||
| launchd.user.agents.rift = { | ||
| command = "${cfg.package}/bin/rift${ | ||
| if configFile == null then "" else " --config " + lib.escapeShellArg configFile | ||
| }"; | ||
|
|
||
| serviceConfig = { | ||
| Label = "git.acsandmann.rift"; | ||
| EnvironmentVariables = { | ||
| RUST_LOG = "error,warn,info"; | ||
| # todo improve | ||
| PATH = "/run/current-system/sw/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"; | ||
| }; | ||
| RunAtLoad = true; | ||
| KeepAlive = { | ||
| SuccessfulExit = false; | ||
| Crashed = true; | ||
| }; | ||
| # todo add _{user} to log file name | ||
| StandardOutPath = "/tmp/rift.out.log"; | ||
| StandardErrorPath = "/tmp/rift.err.log"; | ||
| ProcessType = "Interactive"; | ||
| LimitLoadToSessionType = "Aqua"; | ||
| Nice = -20; | ||
| }; | ||
| }; | ||
| }; | ||
| }; | ||
| } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| inputs: final: prev: | ||
| let | ||
| system = final.system; | ||
| packageModule = (import ./package.nix inputs).perSystem { | ||
| inherit (final) lib; | ||
| pkgs = final; | ||
| inherit system; | ||
| }; | ||
| in | ||
| { | ||
| rift = packageModule.packages.rift; | ||
| rift-bin = packageModule.packages.rift-bin; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the Nix convention to match GitHub release, or Git tag?