Skip to content

Commit

Permalink
Add shell.nix to setup development shell in NixOS
Browse files Browse the repository at this point in the history
  • Loading branch information
yilozt committed Sep 7, 2022
1 parent 72635e4 commit a2f125d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ It will install extensions to `~/.local/share/gnome-shell/extensions`
```
git clone https://github.com/yilozt/rounded-window-corners
cd rounded-window-corners
yarn install
yarn ext:install
yarn install && yarn ext:install
```

In NixOS, you can use `nix-shell` to setup development shell then install
extensions to `~/.local/share/gnome-shell/extensions`.

```
git clone https://github.com/yilozt/rounded-window-corners
cd rounded-window-corners
nix-shell
yarn install && yarn ext:install
```

### From Releases / Github Actions
Expand Down
14 changes: 12 additions & 2 deletions gulp/gi.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ const generate_gi_prefs = (cb) => {
'libraries': conf.libraries_prefs,
...conf
}))
exec(`cd .tmp/prefs && XDG_DATA_DIRS=${extra_lib_prefs}:$XDG_DATA_DIRS gi-ts generate`, cb)
exec(`cd .tmp/prefs && XDG_DATA_DIRS=$GIR_PREFS_PATH:${extra_lib_prefs}:$XDG_DATA_DIRS gi-ts generate`, (err, stdout, stderr) => {
console.log ('Generate .d.ts files for preferences pages: ')
if (stdout) console.log(stdout)
if (stderr) console.log(stderr)
cb(err)
})
}

const generate_gi_ext = (cb) => {
Expand All @@ -134,7 +139,12 @@ const generate_gi_ext = (cb) => {
'libraries': conf.libraries_ext,
...conf
}))
exec(`cd .tmp/ext && XDG_DATA_DIRS=${extra_lib_ext}:$XDG_DATA_DIRS gi-ts generate`, cb)
exec(`cd .tmp/ext && XDG_DATA_DIRS=$GIR_EXT_PATH:${extra_lib_ext}:$XDG_DATA_DIRS gi-ts generate`, (err, stdout, stderr) => {
console.log ('Generate .d.ts files for extensions: ')
if (stdout) console.log(stdout)
if (stderr) console.log(stderr)
cb(err)
})
}

const generate_gi = series(
Expand Down
33 changes: 33 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ pkgs ? import <nixpkgs> { } }:

# Use to setup development shell for NixOS.

with pkgs;
mkShell {
buildInputs = with pkgs; [
yarn
gjs
gtk4
libadwaita
gobject-introspection
gnome.mutter
atk
gtk3
polkit
gcr
networkmanager
graphene
gnome.gnome-shell
];

shellHook = ''
export GIR_EXT_PATH=${
builtins.concatStringsSep ":" [
"${pkgs.gnome.gnome-shell}/share/gnome-shell"
"${pkgs.gnome.mutter}/lib/mutter-10"
"${pkgs.gnome.mutter}/lib/mutter-9"
"${pkgs.gnome.mutter}/lib/mutter-8"
]
}
'';
}

0 comments on commit a2f125d

Please sign in to comment.