chore(nix): update nix flake
This commit is contained in:
parent
0abed4c665
commit
93ee7861e4
6 changed files with 61 additions and 80 deletions
9
Justfile
9
Justfile
|
|
@ -8,18 +8,19 @@ target := if debug == '1' { 'debug' } else { 'release' }
|
||||||
vendor_args := if vendor == '1' { '--frozen --offline' } else { '' }
|
vendor_args := if vendor == '1' { '--frozen --offline' } else { '' }
|
||||||
debug_args := if debug == '1' { '' } else { '--release' }
|
debug_args := if debug == '1' { '' } else { '--release' }
|
||||||
cargo_args := vendor_args + ' ' + debug_args
|
cargo_args := vendor_args + ' ' + debug_args
|
||||||
|
xdp_cosmic := '/usr/libexec/xdg-desktop-portal-cosmic'
|
||||||
|
|
||||||
bindir := prefix + '/bin'
|
bindir := prefix + '/bin'
|
||||||
systemddir := prefix + '/lib/systemd/user'
|
systemddir := prefix + '/lib/systemd/user'
|
||||||
sessiondir := prefix + '/share/wayland-sessions'
|
sessiondir := prefix + '/share/wayland-sessions'
|
||||||
|
|
||||||
all: _extract_vendor
|
all: _extract_vendor build
|
||||||
cargo build {{cargo_args}}
|
|
||||||
|
build:
|
||||||
|
XDP_COSMIC={{xdp_cosmic}} cargo build {{cargo_args}}
|
||||||
|
|
||||||
# Installs files into the system
|
# Installs files into the system
|
||||||
install:
|
install:
|
||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
# main binary
|
# main binary
|
||||||
install -Dm0755 target/release/cosmic-session {{bindir}}/cosmic-session
|
install -Dm0755 target/release/cosmic-session {{bindir}}/cosmic-session
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,5 @@
|
||||||
Name=COSMIC
|
Name=COSMIC
|
||||||
Comment=This session logs you into the COSMIC desktop
|
Comment=This session logs you into the COSMIC desktop
|
||||||
Exec=/usr/bin/start-cosmic
|
Exec=/usr/bin/start-cosmic
|
||||||
TryExec=/usr/bin/start-cosmic
|
|
||||||
Type=Application
|
Type=Application
|
||||||
DesktopNames=pop:COSMIC
|
DesktopNames=COSMIC
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ then
|
||||||
source "${HOME}/.profile"
|
source "${HOME}/.profile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export XDG_CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:=pop:COSMIC}"
|
export XDG_CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:=COSMIC}"
|
||||||
export XDG_SESSION_TYPE="${XDG_SESSION_TYPE:=wayland}"
|
export XDG_SESSION_TYPE="${XDG_SESSION_TYPE:=wayland}"
|
||||||
export XCURSOR_THEME="${XCURSOR_THEME:=Pop}"
|
export XCURSOR_THEME="${XCURSOR_THEME:=Pop}"
|
||||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
|
||||||
101
flake.lock
generated
101
flake.lock
generated
|
|
@ -2,19 +2,16 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"crane": {
|
"crane": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
]
|
||||||
"rust-overlay": "rust-overlay"
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672813857,
|
"lastModified": 1702141249,
|
||||||
"narHash": "sha256-JLDz8J8x+iWYdkqkZnI8wAPTxlXmJI7adhnGNjSDN9I=",
|
"narHash": "sha256-8wDpJKbDTDqFmyJfNEJOLrHYDoEzCjCbmz+lSRoU3CI=",
|
||||||
"owner": "ipetkov",
|
"owner": "ipetkov",
|
||||||
"repo": "crane",
|
"repo": "crane",
|
||||||
"rev": "ec10516aadb705a20b043088072a556e3cb95253",
|
"rev": "62fc1a0cbe144c1014d956e603d56bf1ffe69c7d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -31,11 +28,11 @@
|
||||||
"rust-analyzer-src": "rust-analyzer-src"
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672813381,
|
"lastModified": 1702189261,
|
||||||
"narHash": "sha256-PKt6orRiFO19KFKnOhzK26hbFLtimlRNE2dGwrTEhII=",
|
"narHash": "sha256-TN6gE1eZddDhAoRrScV6Wji1Nk3uqMIDjGwN5ZesAZk=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "fenix",
|
"repo": "fenix",
|
||||||
"rev": "eb6583fcd626051c4d284f2fb51cd2659a43e7f6",
|
"rev": "cae060dbaf53430bb2b549ced0affd54d40e6cee",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -44,44 +41,16 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1668681692,
|
|
||||||
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"inputs": {
|
||||||
"lastModified": 1667395993,
|
"systems": "systems"
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
},
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils_2": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1701680307,
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -92,11 +61,11 @@
|
||||||
},
|
},
|
||||||
"nix-filter": {
|
"nix-filter": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1666547822,
|
"lastModified": 1701697642,
|
||||||
"narHash": "sha256-razwnAybPHyoAyhkKCwXdxihIqJi1G6e1XP4FQOJTEs=",
|
"narHash": "sha256-L217WytWZHSY8GW9Gx1A64OnNctbuDbfslaTEofXXRw=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "nix-filter",
|
"repo": "nix-filter",
|
||||||
"rev": "1a3b735e13e90a8d2fd5629f2f8363bd7ffbbec7",
|
"rev": "c843418ecfd0344ecb85844b082ff5675e02c443",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -107,11 +76,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672756850,
|
"lastModified": 1702206697,
|
||||||
"narHash": "sha256-Smbq3+fitwA13qsTMeaaurv09/KVbZfW7m7lINwzDGA=",
|
"narHash": "sha256-vE9oEx3Y8TO5MnWwFlmopjHd1JoEBno+EhsfUCq5iR8=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "298add347c2bbce14020fcb54051f517c391196b",
|
"rev": "29d6c96900b9b576c2fb89491452f283aa979819",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -125,7 +94,7 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"crane": "crane",
|
"crane": "crane",
|
||||||
"fenix": "fenix",
|
"fenix": "fenix",
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils",
|
||||||
"nix-filter": "nix-filter",
|
"nix-filter": "nix-filter",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
|
@ -133,11 +102,11 @@
|
||||||
"rust-analyzer-src": {
|
"rust-analyzer-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672757238,
|
"lastModified": 1702153490,
|
||||||
"narHash": "sha256-BK1njXsjprMT0f+1aQYmZ/ueN9D3Y3wrz9gw4UvieRQ=",
|
"narHash": "sha256-F98s0+mUHtqiUk9iCApPTy23YMLmcKqTfsShpIPB40Q=",
|
||||||
"owner": "rust-lang",
|
"owner": "rust-lang",
|
||||||
"repo": "rust-analyzer",
|
"repo": "rust-analyzer",
|
||||||
"rev": "a97c71f92d574cb5104e3e1246eb9038d1a214a2",
|
"rev": "9d87a23cdef6087c1a0c97980949e2310271a941",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -147,28 +116,18 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"systems": {
|
||||||
"inputs": {
|
|
||||||
"flake-utils": [
|
|
||||||
"crane",
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"crane",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672712534,
|
"lastModified": 1681028828,
|
||||||
"narHash": "sha256-8S0DdMPcbITnlOu0uA81mTo3hgX84wK8S9wS34HEFY4=",
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
"owner": "oxalica",
|
"owner": "nix-systems",
|
||||||
"repo": "rust-overlay",
|
"repo": "default",
|
||||||
"rev": "69fb7bf0a8c40e6c4c197fa1816773774c8ac59f",
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "oxalica",
|
"owner": "nix-systems",
|
||||||
"repo": "rust-overlay",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
flake.nix
23
flake.nix
|
|
@ -22,12 +22,18 @@
|
||||||
craneLib = crane.lib.${system}.overrideToolchain fenix.packages.${system}.stable.toolchain;
|
craneLib = crane.lib.${system}.overrideToolchain fenix.packages.${system}.stable.toolchain;
|
||||||
|
|
||||||
pkgDef = {
|
pkgDef = {
|
||||||
|
nativeBuildInputs = with pkgs; [ just pkg-config autoPatchelfHook ];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
stdenv.cc.cc.lib
|
||||||
|
];
|
||||||
src = nix-filter.lib.filter {
|
src = nix-filter.lib.filter {
|
||||||
root = ./.;
|
root = ./.;
|
||||||
include = [
|
include = [
|
||||||
./src
|
./src
|
||||||
./Cargo.toml
|
./Cargo.toml
|
||||||
./Cargo.lock
|
./Cargo.lock
|
||||||
|
./Justfile
|
||||||
|
./data
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -41,7 +47,22 @@
|
||||||
inherit cosmic-session;
|
inherit cosmic-session;
|
||||||
};
|
};
|
||||||
|
|
||||||
packages.default = cosmic-session;
|
packages.default = cosmic-session.overrideAttrs (oldAttrs: rec {
|
||||||
|
buildPhase = ''
|
||||||
|
just prefix=$out xdp_cosmic=/run/current-system/sw/bin/xdg-desktop-portal-cosmic build
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstallPhase
|
||||||
|
just prefix=$out install
|
||||||
|
'';
|
||||||
|
preInstallPhase = ''
|
||||||
|
substituteInPlace data/start-cosmic --replace '#!/bin/bash' "#!${pkgs.bash}/bin/bash"
|
||||||
|
substituteInPlace data/start-cosmic --replace '/usr/bin/cosmic-session' "${placeholder "out"}/bin/cosmic-session"
|
||||||
|
substituteInPlace data/start-cosmic --replace '/usr/bin/dbus-run-session' "${pkgs.dbus}/bin/dbus-run-session"
|
||||||
|
substituteInPlace data/cosmic.desktop --replace '/usr/bin/start-cosmic' "${placeholder "out"}/bin/start-cosmic"
|
||||||
|
'';
|
||||||
|
passthru.providedSessions = [ "cosmic" ];
|
||||||
|
});
|
||||||
|
|
||||||
apps.default = flake-utils.lib.mkApp {
|
apps.default = flake-utils.lib.mkApp {
|
||||||
drv = cosmic-session;
|
drv = cosmic-session;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ use tracing_subscriber::{fmt, prelude::*, EnvFilter};
|
||||||
use zbus::ConnectionBuilder;
|
use zbus::ConnectionBuilder;
|
||||||
|
|
||||||
use crate::notifications::notifications_process;
|
use crate::notifications::notifications_process;
|
||||||
|
const XDP_COSMIC: Option<&'static str> = option_env!("XDP_COSMIC");
|
||||||
|
|
||||||
#[tokio::main(flavor = "current_thread")]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
|
|
@ -226,7 +227,7 @@ async fn start(
|
||||||
|
|
||||||
let span = info_span!(parent: None, "xdg-desktop-portal-cosmic");
|
let span = info_span!(parent: None, "xdg-desktop-portal-cosmic");
|
||||||
start_component(
|
start_component(
|
||||||
"/usr/libexec/xdg-desktop-portal-cosmic",
|
XDP_COSMIC.unwrap_or("/usr/libexec/xdg-desktop-portal-cosmic"),
|
||||||
span,
|
span,
|
||||||
&process_manager,
|
&process_manager,
|
||||||
&env_vars,
|
&env_vars,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue