Skip to content

Commit

Permalink
Add support for NixOs (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
ITesserakt authored Feb 25, 2024
1 parent bf8a933 commit 69e78e5
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 1 deletion.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
__pycache__
__pycache__
.idea/
result/
.direnv/
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,26 @@ Since [PEP668 adoption](https://www.linuxuprising.com/2023/03/next-debianubuntu-
3. Install it with `sudo apt -y install ./python3-envycontrol_version.deb`
4. Run `sudo envycontrol -s <MODE>` to switch graphics modes

### Nixos

If you're using Nix Flakes:

- Script could be executed using this command:
```sh
nix run github:ITesserakt/envycontrol -- <args>
```
- For system-wide installation, add this flake to inputs in your configuration:
```sh
inputs = {
# ...
envycontrol.url = github:ITesserakt/envycontrol
};
```
And mention it in the packages like this:
```sh
envycontrol.packages.x86_64-linux.default
```

### From source

1. Clone this repository with `git clone https://github.com/bayasdev/envycontrol.git` or download the latest tarball from the releases page
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.${system} = {
envycontrol = pkgs.python3Packages.buildPythonPackage {
pname = "envycontrol";
version = "3.3.1";
src = self;
};
default = self.packages.${system}.envycontrol;
};

buildInputs = with pkgs; [ pciutils ];

devShells.default = pkgs.mkShellNoCC {
packages = with pkgs; [
(python3.withPackages(ps: with ps; [ setuptools ]))
pciutils
];
};
};
}

0 comments on commit 69e78e5

Please sign in to comment.