Compare commits
No commits in common. "672e07b4ad92812e5c1deab8a40a3f025c84a9fd" and "4c995b533cc49ccd204d861c12187106c9a10435" have entirely different histories.
672e07b4ad
...
4c995b533c
9 changed files with 9 additions and 357 deletions
37
default.nix
37
default.nix
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
rust-overlay ? import (import ./nix/flake-parse.nix "rust-overlay"),
|
|
||||||
pkgs ? import (import ./nix/flake-parse.nix "nixpkgs") {
|
|
||||||
system = builtins.currentSystem;
|
|
||||||
overlays = [ rust-overlay ];
|
|
||||||
},
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
|
|
||||||
extensions = [
|
|
||||||
"rust-analyzer"
|
|
||||||
"rust-src"
|
|
||||||
"llvm-tools"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
shell = import ./nix/shell.nix {
|
|
||||||
inherit pkgs rustToolchain;
|
|
||||||
};
|
|
||||||
|
|
||||||
formatter = import ./nix/formatter.nix { inherit pkgs rustToolchain; };
|
|
||||||
|
|
||||||
packages =
|
|
||||||
let
|
|
||||||
rustPlatform = pkgs.makeRustPlatform {
|
|
||||||
cargo = rustToolchain;
|
|
||||||
rustc = rustToolchain;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
default = pkgs.callPackage ./nix/package.nix {
|
|
||||||
inherit rustPlatform;
|
|
||||||
};
|
|
||||||
sessiond-seat = default;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
45
flake.lock
generated
45
flake.lock
generated
|
|
@ -1,45 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1788881743,
|
|
||||||
"narHash": "sha256-151taSq/21cxagiIu7hyMVl68+FbHfwBP4lh6TB6KOM=",
|
|
||||||
"rev": "d6524aaca2ff07876657ae2b323f24be4874944b",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1069856.d6524aaca2ff/nixexprs.tar.xz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"rust-overlay": "rust-overlay"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rust-overlay": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1788851328,
|
|
||||||
"narHash": "sha256-YOwlUD0Lt/3SulKhZ7z0Jmgbq/DWh8SjnGwUlFSw+YM=",
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"rev": "6ae57a71bcb0bebc7a66cc2bd76942c4cf649167",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
||||||
84
flake.nix
84
flake.nix
|
|
@ -1,84 +0,0 @@
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
|
|
||||||
rust-overlay = {
|
|
||||||
url = "github:oxalica/rust-overlay";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs =
|
|
||||||
{
|
|
||||||
self,
|
|
||||||
nixpkgs,
|
|
||||||
rust-overlay,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
systems = [
|
|
||||||
"x86_64-linux"
|
|
||||||
"aarch64-linux"
|
|
||||||
];
|
|
||||||
|
|
||||||
pkgsFor =
|
|
||||||
system:
|
|
||||||
import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = [ rust-overlay.overlays.default ];
|
|
||||||
};
|
|
||||||
|
|
||||||
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f (pkgsFor system));
|
|
||||||
in
|
|
||||||
{
|
|
||||||
devShells = forAllSystems (pkgs: {
|
|
||||||
default =
|
|
||||||
let
|
|
||||||
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
|
|
||||||
extensions = [
|
|
||||||
"rust-analyzer"
|
|
||||||
"rust-src"
|
|
||||||
"llvm-tools"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
import ./nix/shell.nix { inherit pkgs rustToolchain; };
|
|
||||||
});
|
|
||||||
|
|
||||||
packages = forAllSystems (
|
|
||||||
pkgs:
|
|
||||||
let
|
|
||||||
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
|
|
||||||
extensions = [
|
|
||||||
"rust-analyzer"
|
|
||||||
"rust-src"
|
|
||||||
"llvm-tools"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
rustPlatform = pkgs.makeRustPlatform {
|
|
||||||
cargo = rustToolchain;
|
|
||||||
rustc = rustToolchain;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
cosmic-greeter = pkgs.callPackage ./nix/package.nix {
|
|
||||||
inherit rustPlatform;
|
|
||||||
};
|
|
||||||
default = self.packages.${pkgs.stdenv.hostPlatform.system}.cosmic-greeter;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
formatter = forAllSystems (
|
|
||||||
pkgs:
|
|
||||||
let
|
|
||||||
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
|
|
||||||
extensions = [
|
|
||||||
"rust-analyzer"
|
|
||||||
"rust-src"
|
|
||||||
"llvm-tools"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
import ./nix/formatter.nix { inherit pkgs rustToolchain; }
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
inputName:
|
|
||||||
let
|
|
||||||
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
|
|
||||||
namedNode = lock.nodes.${lock.nodes.root.inputs.${inputName}}.locked;
|
|
||||||
githubTarball = fetchTarball {
|
|
||||||
url =
|
|
||||||
namedNode.url
|
|
||||||
or "https://github.com/${namedNode.owner}/${namedNode.repo}/archive/${namedNode.rev}.tar.gz";
|
|
||||||
sha256 = namedNode.narHash;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
githubTarball
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
{ pkgs, rustToolchain }:
|
|
||||||
pkgs.writeShellApplication {
|
|
||||||
name = "nix3-fmt-wrapper";
|
|
||||||
runtimeInputs = builtins.attrValues {
|
|
||||||
inherit (pkgs)
|
|
||||||
nixfmt
|
|
||||||
taplo
|
|
||||||
fd
|
|
||||||
;
|
|
||||||
inherit rustToolchain;
|
|
||||||
};
|
|
||||||
text = ''
|
|
||||||
fd "$@" -t f -e nix -x nixfmt -q '{}'
|
|
||||||
fd "$@" -t f -e toml -x taplo format '{}'
|
|
||||||
cargo fmt
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
108
nix/package.nix
108
nix/package.nix
|
|
@ -1,108 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
fetchFromGitHub,
|
|
||||||
rustPlatform,
|
|
||||||
libcosmicAppHook,
|
|
||||||
cmake,
|
|
||||||
just,
|
|
||||||
cosmic-randr,
|
|
||||||
dav1d,
|
|
||||||
libinput,
|
|
||||||
linux-pam,
|
|
||||||
udev,
|
|
||||||
coreutils,
|
|
||||||
xkeyboard_config,
|
|
||||||
nixosTests,
|
|
||||||
orca,
|
|
||||||
withLogind ? true,
|
|
||||||
withUpower ? true,
|
|
||||||
withNetworkManager ? true,
|
|
||||||
}:
|
|
||||||
|
|
||||||
rustPlatform.buildRustPackage (finalAttrs: {
|
|
||||||
pname = "cosmic-greeter";
|
|
||||||
version = "1.6.0";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "pop-os";
|
|
||||||
repo = "cosmic-greeter";
|
|
||||||
tag = "epoch-${finalAttrs.version}";
|
|
||||||
hash = "sha256-hDVdl2+7NVLA+YxO2HToni57IEr0i4OGTsYDc3YGTuw=";
|
|
||||||
};
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace src/greeter.rs --replace-fail '/usr/bin/env' '${lib.getExe' coreutils "env"}'
|
|
||||||
substituteInPlace src/greeter.rs --replace-fail '/usr/bin/orca' '${lib.getExe orca}'
|
|
||||||
'';
|
|
||||||
|
|
||||||
cargoHash = "sha256-vHR9go8/iVUT7oBV8h+mmBvhi2oSKNBKtV0uoDOr6go=";
|
|
||||||
|
|
||||||
buildNoDefaultFeatures = true;
|
|
||||||
|
|
||||||
buildFeatures =
|
|
||||||
lib.optionals withLogind [ "logind" ]
|
|
||||||
++ lib.optionals withUpower [ "upower" ]
|
|
||||||
++ lib.optionals withNetworkManager [ "networkmanager" ];
|
|
||||||
|
|
||||||
separateDebugInfo = true;
|
|
||||||
__structuredAttrs = true;
|
|
||||||
|
|
||||||
env.VERGEN_GIT_SHA = finalAttrs.src.tag;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
rustPlatform.bindgenHook
|
|
||||||
cmake
|
|
||||||
just
|
|
||||||
libcosmicAppHook
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
cosmic-randr
|
|
||||||
dav1d
|
|
||||||
libinput
|
|
||||||
linux-pam
|
|
||||||
udev
|
|
||||||
orca
|
|
||||||
];
|
|
||||||
|
|
||||||
dontUseJustBuild = true;
|
|
||||||
dontUseJustCheck = true;
|
|
||||||
|
|
||||||
justFlags = [
|
|
||||||
"--set"
|
|
||||||
"prefix"
|
|
||||||
(placeholder "out")
|
|
||||||
"--set"
|
|
||||||
"cargo-target-dir"
|
|
||||||
"target/${stdenv.hostPlatform.rust.cargoShortTarget}"
|
|
||||||
];
|
|
||||||
|
|
||||||
preFixup = ''
|
|
||||||
libcosmicAppWrapperArgs+=(
|
|
||||||
--prefix PATH : ${lib.makeBinPath [ cosmic-randr ]}
|
|
||||||
--set-default X11_BASE_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/base.xml
|
|
||||||
--set-default X11_BASE_EXTRA_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/extra.xml
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
tests = {
|
|
||||||
inherit (nixosTests)
|
|
||||||
cosmic
|
|
||||||
cosmic-autologin
|
|
||||||
cosmic-noxwayland
|
|
||||||
cosmic-autologin-noxwayland
|
|
||||||
;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
homepage = "https://github.com/pop-os/cosmic-greeter";
|
|
||||||
description = "Greeter for the COSMIC Desktop Environment";
|
|
||||||
mainProgram = "cosmic-greeter";
|
|
||||||
license = lib.licenses.gpl3Only;
|
|
||||||
teams = [ lib.teams.cosmic ];
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
{ pkgs, rustToolchain }:
|
|
||||||
pkgs.mkShell {
|
|
||||||
name = "cosmic-greeter-devshell";
|
|
||||||
packages = builtins.attrValues {
|
|
||||||
inherit
|
|
||||||
rustToolchain
|
|
||||||
;
|
|
||||||
inherit (pkgs)
|
|
||||||
rust-analyzer-unwrapped
|
|
||||||
nixd
|
|
||||||
libxkbcommon
|
|
||||||
dav1d
|
|
||||||
libinput
|
|
||||||
linux-pam
|
|
||||||
gcc
|
|
||||||
glibc
|
|
||||||
cmake
|
|
||||||
;
|
|
||||||
inherit (pkgs.llvmPackages)
|
|
||||||
libclang
|
|
||||||
llvm
|
|
||||||
;
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
|
||||||
|
|
||||||
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library";
|
|
||||||
LLVM_CONFIG_PATH = "${pkgs.llvmPackages.llvm}/bin/llvm-config";
|
|
||||||
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
|
|
||||||
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.linux-pam}/include -I${pkgs.glibc.dev}/include";
|
|
||||||
}
|
|
||||||
|
|
@ -24,7 +24,8 @@ use cosmic::iced::platform_specific::shell::wayland::commands::subsurface::repos
|
||||||
use cosmic::iced::runtime::core::window::Id as SurfaceId;
|
use cosmic::iced::runtime::core::window::Id as SurfaceId;
|
||||||
use cosmic::iced::runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings;
|
use cosmic::iced::runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings;
|
||||||
use cosmic::iced::{
|
use cosmic::iced::{
|
||||||
self, Alignment, Background, Border, Length, Point, Rectangle, Size, Subscription, window,
|
self, Alignment, Background, Border, Color, Length, Point, Rectangle, Size, Subscription,
|
||||||
|
window,
|
||||||
};
|
};
|
||||||
use cosmic::widget::{id_container, text};
|
use cosmic::widget::{id_container, text};
|
||||||
use cosmic::{Element, executor, surface, theme, widget};
|
use cosmic::{Element, executor, surface, theme, widget};
|
||||||
|
|
@ -279,6 +280,8 @@ pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
sessions
|
sessions
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let logind_available = cfg!(feature = "logind") && crate::logind::is_available();
|
||||||
|
|
||||||
let flags = Flags {
|
let flags = Flags {
|
||||||
user_icons: user_datas
|
user_icons: user_datas
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
|
|
@ -288,10 +291,7 @@ pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
sessions,
|
sessions,
|
||||||
greeter_config,
|
greeter_config,
|
||||||
greeter_config_handler,
|
greeter_config_handler,
|
||||||
#[cfg(feature = "logind")]
|
logind_available,
|
||||||
logind_available: crate::logind::is_available(),
|
|
||||||
#[cfg(not(feature = "logind"))]
|
|
||||||
logind_available: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let settings = Settings::default().no_main_window(true);
|
let settings = Settings::default().no_main_window(true);
|
||||||
|
|
@ -1181,12 +1181,6 @@ impl cosmic::Application for App {
|
||||||
fn update(&mut self, message: Self::Message) -> Task<Message> {
|
fn update(&mut self, message: Self::Message) -> Task<Message> {
|
||||||
match message {
|
match message {
|
||||||
Message::Common(common_message) => {
|
Message::Common(common_message) => {
|
||||||
if matches!(&common_message, common::Message::Prompt(_, _, Some(_)))
|
|
||||||
&& self.authenticating
|
|
||||||
{
|
|
||||||
self.authenticating = false;
|
|
||||||
self.common.prompt_opt = None;
|
|
||||||
}
|
|
||||||
// In greetd's IPC protocol, the greeter must acknowledge auth messages by
|
// In greetd's IPC protocol, the greeter must acknowledge auth messages by
|
||||||
// sending PostAuthMessageResponse. For non-interactive "info" messages
|
// sending PostAuthMessageResponse. For non-interactive "info" messages
|
||||||
// (fingerprint prompts typically come through here), the correct response
|
// (fingerprint prompts typically come through here), the correct response
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,8 @@ pub fn main(user: pwd::Passwd) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
// We are already the user at this point
|
// We are already the user at this point
|
||||||
user_data.load_config_as_user();
|
user_data.load_config_as_user();
|
||||||
|
|
||||||
|
let logind_available = cfg!(feature = "logind") && crate::logind::is_available();
|
||||||
|
|
||||||
let flags = Flags {
|
let flags = Flags {
|
||||||
user_icon: user_data
|
user_icon: user_data
|
||||||
.icon_opt
|
.icon_opt
|
||||||
|
|
@ -86,10 +88,7 @@ pub fn main(user: pwd::Passwd) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
.map(widget::image::Handle::from_bytes),
|
.map(widget::image::Handle::from_bytes),
|
||||||
user_data,
|
user_data,
|
||||||
lockfile_opt: lockfile_opt(),
|
lockfile_opt: lockfile_opt(),
|
||||||
#[cfg(feature = "logind")]
|
logind_available,
|
||||||
logind_available: crate::logind::is_available(),
|
|
||||||
#[cfg(not(feature = "logind"))]
|
|
||||||
logind_available: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let settings = Settings::default().no_main_window(true);
|
let settings = Settings::default().no_main_window(true);
|
||||||
|
|
@ -710,12 +709,6 @@ impl cosmic::Application for App {
|
||||||
match message {
|
match message {
|
||||||
Message::None => {}
|
Message::None => {}
|
||||||
Message::Common(common_message) => {
|
Message::Common(common_message) => {
|
||||||
if matches!(&common_message, common::Message::Prompt(_, _, Some(_)))
|
|
||||||
&& self.authenticating
|
|
||||||
{
|
|
||||||
self.authenticating = false;
|
|
||||||
self.common.prompt_opt = None;
|
|
||||||
}
|
|
||||||
return self.common.update(common_message);
|
return self.common.update(common_message);
|
||||||
}
|
}
|
||||||
Message::OutputEvent(output_event, output) => {
|
Message::OutputEvent(output_event, output) => {
|
||||||
|
|
@ -1227,8 +1220,7 @@ impl cosmic::Application for App {
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(feature = "logind")]
|
if cfg!(feature = "logind") && self.flags.logind_available {
|
||||||
if self.flags.logind_available {
|
|
||||||
subscriptions.push(crate::logind::subscription());
|
subscriptions.push(crate::logind::subscription());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue